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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user