altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
187 stars 58 forks source link

Close socket on disconnect #148

Open elParaguayo opened 1 year ago

elParaguayo commented 1 year ago

As per issue #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 #137

elParaguayo commented 1 year ago

Not sure why test_tcp_connection_with_forwarding fails as it doesn't call bus.disconnect which is the only code I've changed.