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 1a35a71706..623d8deac9 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -171,7 +171,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)); LLWebRTCVoiceClient::getInstance()->userAuthorized(user_id, agentID); LLVivoxVoiceClient::getInstance()->userAuthorized(user_id, agentID); } @@ -608,8 +612,14 @@ bool LLVoiceClient::voiceEnabled() void LLVoiceClient::setVoiceEnabled(bool enabled) { - LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled); - LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled); + if (LLWebRTCVoiceClient::instanceExists()) + { + LLWebRTCVoiceClient::getInstance()->setVoiceEnabled(enabled); + } + if (LLVivoxVoiceClient::instanceExists()) + { + LLVivoxVoiceClient::getInstance()->setVoiceEnabled(enabled); + } } void LLVoiceClient::updateMicMuteLogic() |