diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-11-01 01:29:06 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-11-01 17:54:05 +0200 |
commit | 0114be2c155ed5a3de17f6b49d06fab607b9d6bf (patch) | |
tree | bdd1ee334c90b017403215bf874ed443dd75fc6f /indra/newview/llfloaterimsessiontab.cpp | |
parent | cbd713037e5636b9f3c360332e23e0e29d2972ce (diff) |
viewer#2985 Odd crash when notifying voice observers
Crash points at enableDisableCallBtn, but button's floater was cleaned
earlier and has a removeObserver call so an observer record should be
long gone. Likely something else is going on.
Went over various callbacks and made sure they are cleaned. But in case
floater somehow remained, added mSession = nullptr.
Diffstat (limited to 'indra/newview/llfloaterimsessiontab.cpp')
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index fe0916bf15..af38d696bc 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -80,6 +80,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) { setAutoFocus(false); mSession = LLIMModel::getInstance()->findIMSession(mSessionID); + LLIMMgr::instance().addSessionObserver(this); mCommitCallbackRegistrar.add("IMSession.Menu.Action", boost::bind(&LLFloaterIMSessionTab::onIMSessionMenuItemClicked, this, _2)); @@ -102,6 +103,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) LLFloaterIMSessionTab::~LLFloaterIMSessionTab() { delete mRefreshTimer; + LLIMMgr::instance().removeSessionObserver(this); LLFloaterIMContainer* im_container = LLFloaterIMContainer::findInstance(); if (im_container) @@ -440,7 +442,10 @@ void LLFloaterIMSessionTab::enableDisableCallBtn() bool enable = false; - if (mSessionID.notNull() && mSession && mSession->mSessionInitialized && mSession->mCallBackEnabled) + if (mSessionID.notNull() + && mSession + && mSession->mSessionInitialized + && mSession->mCallBackEnabled) { if (mVoiceButtonHangUpMode) { @@ -450,9 +455,10 @@ void LLFloaterIMSessionTab::enableDisableCallBtn() else { // We allow to start call from this state only - if (mSession->mVoiceChannel && - !mSession->mVoiceChannel->callStarted() && - LLVoiceClient::instanceExists()) + if (LLVoiceClient::instanceExists() && + mSession->mVoiceChannel && + !mSession->mVoiceChannel->callStarted() + ) { LLVoiceClient* client = LLVoiceClient::getInstance(); if (client->voiceEnabled() && client->isVoiceWorking()) @@ -1366,6 +1372,14 @@ LLView* LLFloaterIMSessionTab::getChatHistory() return mChatHistory; } +void LLFloaterIMSessionTab::sessionRemoved(const LLUUID& session_id) +{ + if (session_id == mSessionID) + { + mSession = nullptr; + } +} + bool LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask ) { bool handled = false; |