You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release local publication and Rtc source FFI handles on cleanup
After the previous commit, Room cleanup walked participants and disposed
their handles, including the publication handles for remote tracks. Three
local-side handles still leaked on every disconnect:
- LocalTrackPublication never wrapped its FFI handle. When PublishTrack
succeeded, OnPublish constructed the C# publication from the proto info
alone and dropped e.Publication.Handle on the floor. The Rust side kept
the entry alive in the FFI handle table for the rest of the process.
- RtcVideoSource and RtcAudioSource owned an FFI source handle but their
Dispose(bool) implementations released the preview texture, capture
buffer, and pending audio frames without ever disposing the handle. The
source therefore stayed registered with Rust until the SafeHandle
finalizer eventually ran.
Wrap the publication handle in the PublishTrackInstruction callback and
dispose it through the existing DisposeHandles cascade. Add Handle
disposal to the two Rtc source Dispose(bool) overrides so the Meet
sample's CleanUpAllTracks now actually frees them.
With this change, disconnecting after publishing local mic + camera
returns the FFI handle table to its pre-connect baseline on macOS.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments