Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix_localtrackpublished_handle_leak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
livekit-ffi: patch
---

Fix LocalTrackPublished handle leak - #1065 (@MaxHeimbrock)
9 changes: 3 additions & 6 deletions livekit-ffi/src/server/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,9 @@ async fn forward_event(
}
}

let ffi_publication = FfiPublication {
handle: server.next_id(),
publication: TrackPublication::Local(publication),
};
server.store_handle(ffi_publication.handle, ffi_publication);

// The PublishTrackCallback already gave the foreign side a wrapped publication
// handle. Allocating a second FfiPublication here would store an entry in the
// handle table whose id is never communicated to the client — pure leak.
let _ = send_event(proto::LocalTrackPublished { track_sid: sid.to_string() }.into());
}
RoomEvent::LocalTrackUnpublished { publication, participant: _ } => {
Expand Down
Loading