From 0114be2c155ed5a3de17f6b49d06fab607b9d6bf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 1 Nov 2024 01:29:06 +0200 Subject: viewer#2985 Odd crash when notifying voice observers Crash points at enableDisableCallBtn, but button's floater was cleaned earlier and has a removeObserver call so an observer record should be long gone. Likely something else is going on. Went over various callbacks and made sure they are cleaned. But in case floater somehow remained, added mSession = nullptr. --- indra/newview/llspeakingindicatormanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llspeakingindicatormanager.cpp') diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index a9ef5e244d..532b245ced 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -133,6 +133,8 @@ private: * @see onChange() */ speaker_ids_t mSwitchedIndicatorsOn; + + boost::signals2::connection mVoiceChannelChanged; }; ////////////////////////////////////////////////////////////////////////// @@ -181,7 +183,7 @@ void SpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker ////////////////////////////////////////////////////////////////////////// SpeakingIndicatorManager::SpeakingIndicatorManager() { - LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1)); + mVoiceChannelChanged = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1)); LLVoiceClient::addObserver(this); } -- cgit v1.2.3