Skip to content

Comments

fix: ensure tracks are stopped when disposing a Publisher#1676

Merged
oliverlaz merged 2 commits intomainfrom
dispose-tracks
Feb 7, 2025
Merged

fix: ensure tracks are stopped when disposing a Publisher#1676
oliverlaz merged 2 commits intomainfrom
dispose-tracks

Conversation

@oliverlaz
Copy link
Member

Overview

In some circumstances, we were dangling track clones. No data flowed to the SFU, but the browser kept the camera/mic indicators on as there were MediaStreamTrack instances that weren't stopped properly.

Implementation notes

Upon disposing of a Publisher, we now iterate through all transceivers and we explicitly stop the assigned track.
This PR also fixes another issue that could lead to dangling, unstopped tracks when replacing a track on an existing transceiver.

@oliverlaz oliverlaz merged commit 948f672 into main Feb 7, 2025
15 checks passed
@oliverlaz oliverlaz deleted the dispose-tracks branch February 7, 2025 16:47
oliverlaz added a commit that referenced this pull request Feb 10, 2025
Continuation on #1676. We were still leaking tracks in iOS Safari.

### Implementation notes

Aggressively keep track of cloned tracks in Publisher and ensure all of
them are stopped when it is disposed of.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants