diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e1dca4ae43527c0cd808471e5f60bf0d00e3ce1b..5c107cc10bd2a6833cb1888e1f8cc58973d12202 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -839,7 +839,7 @@ void LLVoiceClient::addObserver(LLVoiceClientStatusObserver* observer) void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer) { - if (mVoiceModule) mVoiceModule->removeObserver(observer); + if (mVoiceModule && mVoiceModule->singletoneInstanceExists()) mVoiceModule->removeObserver(observer); } void LLVoiceClient::addObserver(LLFriendObserver* observer) @@ -849,7 +849,7 @@ void LLVoiceClient::addObserver(LLFriendObserver* observer) void LLVoiceClient::removeObserver(LLFriendObserver* observer) { - if (mVoiceModule) mVoiceModule->removeObserver(observer); + if (mVoiceModule && mVoiceModule->singletoneInstanceExists()) mVoiceModule->removeObserver(observer); } void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) @@ -859,7 +859,7 @@ void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer) { - if (mVoiceModule) mVoiceModule->removeObserver(observer); + if (mVoiceModule && mVoiceModule->singletoneInstanceExists()) mVoiceModule->removeObserver(observer); } std::string LLVoiceClient::sipURIFromID(const LLUUID &id) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 337f01f3e53573639673603609f17cc419014a48..758e9cecd76acd69cdafc782cca61bfd85096430 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -121,6 +121,8 @@ public: virtual const LLVoiceVersionInfo& getVersion()=0; + virtual bool singletoneInstanceExists()=0; + ///////////////////// /// @name Tuning //@{ diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index b039afa73418b118a8fed76aa87afc7c1e283df1..ee333bcee2815d2d3d8f871eadbb1c963eb944af 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4726,6 +4726,11 @@ void LLVivoxVoiceClient::declineInvite(std::string &sessionHandle) } } +bool LLVivoxVoiceClient::singletoneInstanceExists() +{ + return LLVivoxVoiceClient::instanceExists(); +} + void LLVivoxVoiceClient::leaveNonSpatialChannel() { LL_DEBUGS("Voice") << "Request to leave spacial channel." << LL_ENDL; diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 50862cea1ee941f9d2b51d1e7ceba397ff473e1f..210c7264527fe8f591e007c6eb8c411221f8bfd1 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -73,6 +73,8 @@ public: // Returns true if vivox has successfully logged in and is not in error state virtual bool isVoiceWorking() const; + + virtual bool singletoneInstanceExists(); ///////////////////// /// @name Tuning