+2
-1
@@ -574,6 +574,7 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek
|
|||||||
r.lock.Unlock()
|
r.lock.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
r.removeParticipantWorkerLocked(p)
|
||||||
|
|
||||||
if pID != "" && p.ID() != pID {
|
if pID != "" && p.ID() != pID {
|
||||||
// participant session has been replaced
|
// participant session has been replaced
|
||||||
@@ -582,7 +583,6 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete(r.participants, identity)
|
delete(r.participants, identity)
|
||||||
r.removeParticipantWorkerLocked(p)
|
|
||||||
delete(r.participantOpts, identity)
|
delete(r.participantOpts, identity)
|
||||||
delete(r.participantRequestSources, identity)
|
delete(r.participantRequestSources, identity)
|
||||||
delete(r.hasPublished, identity)
|
delete(r.hasPublished, identity)
|
||||||
@@ -1529,6 +1529,7 @@ func (r *Room) removeParticipantWorkerLocked(p types.LocalParticipant) {
|
|||||||
for idx, participant := range pw.participants {
|
for idx, participant := range pw.participants {
|
||||||
if p == participant {
|
if p == participant {
|
||||||
pw.participants[idx] = pw.participants[n-1]
|
pw.participants[idx] = pw.participants[n-1]
|
||||||
|
pw.participants[n-1] = nil
|
||||||
pw.participants = pw.participants[:n-1]
|
pw.participants = pw.participants[:n-1]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user