Avoid duplicate track add to room track manager. (#4152)

* Avoid duplicate track add to room track manager.

Don't have proof that this happens, but in the leak chase, this is
another component at room level and holds references to tracks. Guessing
this is not cleaning tracks till room is closed.

* add a report
This commit is contained in:
Raja Subramanian
2025-12-12 12:42:04 +05:30
committed by GitHub
parent f01008f876
commit a0a28ac5e3
2 changed files with 43 additions and 4 deletions
+1 -1
View File
@@ -265,7 +265,6 @@ func NewRoom(
agentClient: agentClient,
agentStore: agentStore,
agentDispatches: make(map[string]*agentDispatch),
trackManager: NewRoomTrackManager(),
serverInfo: serverInfo,
participants: make(map[livekit.ParticipantIdentity]types.LocalParticipant),
participantOpts: make(map[livekit.ParticipantIdentity]*ParticipantOptions),
@@ -284,6 +283,7 @@ func NewRoom(
MaxSize: dataMessageCacheSize,
}),
}
r.trackManager = NewRoomTrackManager(r.logger)
r.localParticipantListener = &localParticipantListener{room: r}
if r.protoRoom.EmptyTimeout == 0 {