Unverified 提交 609fbd4b authored 作者: SteveMcFarlin's avatar SteveMcFarlin 提交者: GitHub

Erase the dominantId after removal from the map. (#634)

This fixes a bug where by ActiveSpeakerObserver::CalculateActiveSpeaker()
may cause a crash due to a nullptr. While there is a check after getting
the dominantSpeaker from the map we have notice it will pass the check,
and then crash in EvalActivityScores.
上级 73ec18a8
......@@ -149,12 +149,14 @@ namespace RTC
if (it->second.speaker != nullptr)
{
delete it->second.speaker;
it->second.speaker = nullptr;
}
this->mapProducerSpeaker.erase(producer->id);
if (producer->id == this->dominantId)
{
this->dominantId.erase();
Update();
}
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论