Revert "Plug worker leaks" (#2427)

This commit is contained in:
Raja Subramanian
2024-01-29 12:40:55 +05:30
committed by GitHub
parent 846121e781
commit ad072f0836
+1 -2
View File
@@ -574,7 +574,6 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek
r.lock.Unlock()
return
}
r.removeParticipantWorkerLocked(p)
if pID != "" && p.ID() != pID {
// participant session has been replaced
@@ -583,6 +582,7 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek
}
delete(r.participants, identity)
r.removeParticipantWorkerLocked(p)
delete(r.participantOpts, identity)
delete(r.participantRequestSources, identity)
delete(r.hasPublished, identity)
@@ -1529,7 +1529,6 @@ func (r *Room) removeParticipantWorkerLocked(p types.LocalParticipant) {
for idx, participant := range pw.participants {
if p == participant {
pw.participants[idx] = pw.participants[n-1]
pw.participants[n-1] = nil
pw.participants = pw.participants[:n-1]
break
}