Fix RTCP reader leak in DownTrack. (#4131)

When a participant is closing, RTCP readers should be cleaned up from
factory even if the participant is expected to resume. The resumed
participant will be a new participant session and peer connection(s) and
everything will be set up again.
This commit is contained in:
Raja Subramanian
2025-12-06 17:49:23 +05:30
committed by GitHub
parent 3eef869a68
commit 8c241ecf12
3 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -287,10 +287,10 @@ func (t *MediaTrackSubscriptions) closeSubscribedTrack(subTrack types.Subscribed
}
if isExpectedToResume {
dt.CloseWithFlush(false)
dt.CloseWithFlush(false, false)
} else {
// flushing blocks, avoid blocking when publisher removes all its subscribers
go dt.CloseWithFlush(true)
go dt.CloseWithFlush(true, true)
}
}
+2 -2
View File
@@ -128,12 +128,12 @@ func (m *SubscriptionManager) Close(isExpectedToResume bool) {
if isExpectedToResume {
for _, dt := range downTracksToClose {
dt.CloseWithFlush(false)
dt.CloseWithFlush(false, true)
}
} else {
// flush blocks, so execute in parallel
for _, dt := range downTracksToClose {
go dt.CloseWithFlush(true)
go dt.CloseWithFlush(true, true)
}
}