Can't delete from a map while iterating over it.
parent
2c50399720
commit
f9cb9a2b05
|
|
@ -1230,16 +1230,19 @@ void LLWebRTCVoiceClient::sessionState::removeParticipant(const LLWebRTCVoiceCli
|
|||
|
||||
void LLWebRTCVoiceClient::sessionState::removeAllParticipants(const LLUUID ®ion)
|
||||
{
|
||||
LL_DEBUGS("Voice") << "called" << LL_ENDL;
|
||||
std::vector<participantStatePtr_t> participantsToRemove;
|
||||
|
||||
|
||||
for (auto &&participant : mParticipantsByUUID)
|
||||
for (auto& participantEntry : mParticipantsByUUID)
|
||||
{
|
||||
if (region.isNull() || (participant.second->mRegion == region))
|
||||
if (region.isNull() || (participantEntry.second->mRegion == region))
|
||||
{
|
||||
removeParticipant(participant.second);
|
||||
participantsToRemove.push_back(participantEntry.second);
|
||||
}
|
||||
}
|
||||
for (auto& participant : participantsToRemove)
|
||||
{
|
||||
removeParticipant(participant);
|
||||
}
|
||||
}
|
||||
|
||||
// Initiated the various types of sessions.
|
||||
|
|
|
|||
Loading…
Reference in New Issue