From c357ead5fd6afbdef30c2d591f7c572bb5c9aded Mon Sep 17 00:00:00 2001 From: Daisuke Murase Date: Thu, 2 Jan 2025 19:04:56 -0800 Subject: [PATCH] store empty handle for existing ffi clients --- livekit-ffi/src/server/room.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/livekit-ffi/src/server/room.rs b/livekit-ffi/src/server/room.rs index 01fd7a82..2c46b380 100644 --- a/livekit-ffi/src/server/room.rs +++ b/livekit-ffi/src/server/room.rs @@ -269,7 +269,10 @@ impl FfiRoom { pub async fn close(&self, server: &'static FfiServer) { // drop associated track handles for (_, &handle) in self.inner.track_handle_lookup.lock().iter() { - server.drop_handle(handle); + if server.drop_handle(handle) { + // Store an empty handle for the FFI client that assumes a handle exists for this id. + server.store_handle(handle, vec![].into_boxed_slice()); + } } let _ = self.inner.room.close().await;