diff options
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r-- | indra/newview/llchiclet.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index a076374903..a661808d1f 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -250,6 +250,12 @@ LLIMWellChiclet::LLIMWellChiclet(const Params& p) LLIMWellChiclet::~LLIMWellChiclet() { + LLIMWellWindow* im_well_window = LLIMWellWindow::findInstance(); + if (im_well_window) + { + im_well_window->setSysWellChiclet(NULL); + } + LLIMMgr::getInstance()->removeSessionObserver(this); } @@ -296,6 +302,13 @@ void LLIMWellChiclet::createMenu() void LLIMWellChiclet::messageCountChanged(const LLSD& session_data) { + // The singleton class LLChicletBar instance might be already deleted + // so don't create a new one. + if (!LLChicletBar::instanceExists()) + { + return; + } + const LLUUID& session_id = session_data["session_id"]; const S32 counter = LLChicletBar::getInstance()->getTotalUnreadIMCount(); const bool im_not_visible = !LLFloaterReg::instanceVisible("im_container") @@ -1100,8 +1113,8 @@ LLChicletPanel::~LLChicletPanel() } } -void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ - +void LLChicletPanel::onMessageCountChanged(const LLSD& data) +{ LLUUID session_id = data["session_id"].asUUID(); S32 unread = data["participant_unread"].asInteger(); @@ -1126,7 +1139,7 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ } } -void object_chiclet_callback(const LLSD& data) +void LLChicletPanel::objectChicletCallback(const LLSD& data) { LLUUID notification_id = data["notification_id"]; bool new_message = data["new_message"]; @@ -1150,10 +1163,10 @@ void object_chiclet_callback(const LLSD& data) BOOL LLChicletPanel::postBuild() { LLPanel::postBuild(); - LLIMModel::instance().addNewMsgCallback(boost::bind(im_chiclet_callback, this, _1)); - LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(im_chiclet_callback, this, _1)); - LLScriptFloaterManager::getInstance()->addNewObjectCallback(boost::bind(object_chiclet_callback, _1)); - LLScriptFloaterManager::getInstance()->addToggleObjectFloaterCallback(boost::bind(object_chiclet_callback, _1)); + LLIMModel::instance().addNewMsgCallback(boost::bind(&LLChicletPanel::onMessageCountChanged, this, _1)); + LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLChicletPanel::onMessageCountChanged, this, _1)); + LLScriptFloaterManager::getInstance()->addNewObjectCallback(boost::bind(&LLChicletPanel::objectChicletCallback, this, _1)); + LLScriptFloaterManager::getInstance()->addToggleObjectFloaterCallback(boost::bind(&LLChicletPanel::objectChicletCallback, this, _1)); LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet<LLChiclet>, this, _1)); LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1)); |