diff options
Diffstat (limited to 'indra/newview/llvoiceclient.cpp')
-rw-r--r-- | indra/newview/llvoiceclient.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 846c2b8867..3d8ffc35e7 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -177,7 +177,11 @@ void LLVoiceClient::init(LLPumpIO *pump) void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &agentID) { - gAgent.addRegionChangedCallback(boost::bind(&LLVoiceClient::onRegionChanged, this)); + if (mRegionChangedCallbackSlot.connected()) + { + mRegionChangedCallbackSlot.disconnect(); + } + mRegionChangedCallbackSlot = gAgent.addRegionChangedCallback(boost::bind(&LLVoiceClient::onRegionChanged, this)); #if !__FreeBSD__ LLWebRTCVoiceClient::getInstance()->userAuthorized(user_id, agentID); #endif @@ -683,9 +687,15 @@ bool LLVoiceClient::voiceEnabled() void LLVoiceClient::setVoiceEnabled(bool enabled) { #if !__FreeBSD__ - LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled); + if (LLWebRTCVoiceClient::instanceExists()) + { + LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled); + } #endif - LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled); + if (LLVivoxVoiceClient::instanceExists()) + { + LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled); + } } void LLVoiceClient::updateMicMuteLogic() |