diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index c58e98b3fb4f97b66eccd436a4b8c499acf99694..f971554c9dec325563225c1c4d109fb27769d245 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -74,10 +74,18 @@ LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& sess LLVoiceChannel::~LLVoiceChannel() { - // Must check instance exists here, the singleton MAY have already been destroyed. - if(LLVoiceClient::instanceExists()) + if (sSuspendedVoiceChannel == this) { - LLVoiceClient::getInstance()->removeObserver(this); + sSuspendedVoiceChannel = NULL; + } + if (sCurrentVoiceChannel == this) + { + sCurrentVoiceChannel = NULL; + // Must check instance exists here, the singleton MAY have already been destroyed. + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->removeObserver(this); + } } sVoiceChannelMap.erase(mSessionID);