Prevent subscription after participant close. (#1182)

This commit is contained in:
Raja Subramanian
2022-11-23 09:10:44 +05:30
committed by GitHub
parent e5dabd466e
commit 491a15e49e
+5
View File
@@ -1949,6 +1949,11 @@ func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
}
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub types.LocalParticipant) error) {
// do not queue subscription is participant is already closed/disconnected
if p.isClosed.Load() || p.State() == livekit.ParticipantInfo_DISCONNECTED {
return
}
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID, "relayed", isRelayed)
p.supervisor.UpdateSubscription(trackID, true)