Skip to content

Commit

Permalink
Close socket on disconnect
Browse files Browse the repository at this point in the history
As per issue altdesktop#137, sockets are not closed when the bus is disconnected.
This results in users receiving warnings about unclosed sockets.

This PR adds a call to the socket's `close` method during `disconnect`.

Closes altdesktop#137
  • Loading branch information
elParaguayo committed Jan 7, 2023
1 parent ab566e1 commit 1c13ced
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dbus_next/message_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def disconnect(self):
self._user_disconnect = True
try:
self._sock.shutdown(socket.SHUT_RDWR)
self._sock.close()
except Exception:
logging.warning('could not shut down socket', exc_info=True)

Expand Down

0 comments on commit 1c13ced

Please sign in to comment.