-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bluez: syncronize disconnect and cleanup
When the following sequence of events occured, `assert self._bus is None` would be hit. - A "Connected": False property change signal is sent over D-Bus. - Bleak handles the event and calls the `_cleanup_all()` method. - The `_cleanup_all()` sends a D-Bus message to unsubscribe from signals and awaits it. - While the previous method is still awaiting, the disconnect method is called. - This method hits an assertation because the connected property is false but there is still a D-Bus bus connection since `_cleanup_all()` is still using it. This fixes the issue by making `_cleanup_all()` a syncronous method. Since we are closing the bus connection, we should not need to remove signal watchers first. Fixes #641.
- Loading branch information
Showing
2 changed files
with
13 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters