Skip to content

Commit

Permalink
store empty handle for existing ffi clients
Browse files Browse the repository at this point in the history
  • Loading branch information
typester committed Jan 3, 2025
1 parent ccc33f4 commit c357ead
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion livekit-ffi/src/server/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c357ead

Please sign in to comment.