aboutsummaryrefslogtreecommitdiff
path: root/avatar
diff options
context:
space:
mode:
authorAbel Lucas <uael@google.com>2023-03-21 18:15:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-03-21 18:15:23 +0000
commitce72ac4864baa84a08d334fafcd8729583bb7f47 (patch)
tree25d059e36d194dc0a1638762ffb46ff5b6486739 /avatar
parent3cfc3887c191c4053649b15951ef274d0db270d3 (diff)
parent7010b7427852984c0c5b54c1dd5693316774a291 (diff)
downloadavatar-ce72ac4864baa84a08d334fafcd8729583bb7f47.tar.gz
Merge "bumble: fix missing listener removal on `WaitDisconnection`" into main
Diffstat (limited to 'avatar')
-rw-r--r--avatar/bumble_server/host.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/avatar/bumble_server/host.py b/avatar/bumble_server/host.py
index a9f3b70..3957389 100644
--- a/avatar/bumble_server/host.py
+++ b/avatar/bumble_server/host.py
@@ -232,8 +232,11 @@ class HostService(HostServicer):
disconnection_future.set_result(None)
connection.on('disconnection', on_disconnection)
- await disconnection_future
- self.log.info("Disconnected")
+ try:
+ await disconnection_future
+ self.log.info("Disconnected")
+ finally:
+ connection.remove_listener('disconnection', on_disconnection) # type: ignore
return empty_pb2.Empty()