We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be92457 commit 91f5a9eCopy full SHA for 91f5a9e
1 file changed
livekit-rtc/livekit/rtc/room.py
@@ -562,6 +562,12 @@ def on_participant_connected(participant):
562
# start listening to room events
563
self._task = self._loop.create_task(self._listen_task())
564
565
+ # unsubscribe from the FFI queue once the listen task ends.
566
+ # disconnect() unsubscribes too, but it early-returns when the
567
+ # room is already disconnected (e.g. removed remotely).
568
+ ffi_queue = self._ffi_queue
569
+ self._task.add_done_callback(lambda _: FfiClient.instance.queue.unsubscribe(ffi_queue))
570
+
571
# Unblock the FFI server once this SDK is ready to receive room events.
572
ready_req = proto_ffi.FfiRequest()
573
ready_req.ready_for_room_event.room_handle = self._ffi_handle.handle
0 commit comments