MAINT-8959 Fixed some pointers not being reset

meow-7.2.2
andreykproductengine 2018-08-07 17:23:27 +03:00
parent ac5a547019
commit da4d270695
1 changed files with 11 additions and 3 deletions

View File

@ -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);