From d5e97617c661dd3518ef1caa6903867ad044df8d Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 1 Feb 2010 17:48:25 +0200 Subject: Fixed major bug EXT-4782 (Viewer crashes if end ad-hoc voice chat by 'End session' context commant of chiclet) - reason: indicator on ad-hoc chiclets is changed its speaker UUID that leads to registering the same instances several times in the SpeakingIndicatorManager. This leads to crash after instance is destroyed because the only one (specified by UUID in unregisterSpeakingIndicator()) is removed from the map. So, using stored deleted pointer leads to crash. See EXT-4782. - fix: prevent regestering the same instance of indicator by removing existing one in LLOutputMonitorCtrl::setSpeakerId. Also added check in SpeakingIndicatorManager to prevent such situation in the future with an appropriate warning & assert. --HG-- branch : product-engine --- indra/newview/lloutputmonitorctrl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index f816dc589d..388fdeea7a 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -251,6 +251,11 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id) { if (speaker_id.isNull() || speaker_id == mSpeakerId) return; + if (mSpeakerId.notNull()) + { + // Unregister previous registration to avoid crash. EXT-4782. + LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this); + } mSpeakerId = speaker_id; LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this); -- cgit v1.2.3