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