Skip to content

Commit

Permalink
fix: prevent monitoring leak when stopOnUnpublish is false
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao committed Dec 7, 2024
1 parent 8b63132 commit 4ef1076
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,8 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
if (shouldStopTracks) {
pub.track?.detach();
pub.track?.stop();
} else {
pub.track?.stopMonitor();
}
});

Expand Down
2 changes: 2 additions & 0 deletions src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,8 @@ export default class LocalParticipant extends Participant {
}
if (stopOnUnpublish) {
track.stop();
} else {
track.stopMonitor();
}

let negotiationNeeded = false;
Expand Down

0 comments on commit 4ef1076

Please sign in to comment.