diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-05 17:38:01 +0300 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-05 17:38:01 +0300 |
commit | 54bf954b16c63f9b7be457b48ee5655627831856 (patch) | |
tree | 621c6bfba415136d93045ad60596023efa38f135 /indra/newview | |
parent | a05c48cf140f483546828fa264c8904d190d46bc (diff) |
EXT-8226 FIXED Potential fix for a crash at startup in LLIMWellWindow::findIMChiclet().
Bug reason: LLChicletPanel::onCurrentVoiceChannelChanged() was called at startup, which, in turn, called LLIMWellWindow::findIMChiclet().
Apparently, LLIMWellWindow::mMessageList was not initialized yet, so dereferencing the null pointer caused the crash.
I couldn't reproduce the crash so I've just added defensive checks (just for any case)
and moved binding LLIMWellWindow::findIMChiclet() to sFindChicletsSignal from the constructor to postBuild().
Reviewed by Alexei Arabadji at https://codereview.productengine.com/secondlife/r/692/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llsyswellwindow.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index cb65756764..e6b4aeb6c2 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -582,8 +582,6 @@ LLIMWellWindow::LLIMWellWindow(const LLSD& key) : LLSysWellWindow(key) { LLIMMgr::getInstance()->addSessionObserver(this); - LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLIMWellWindow::findIMChiclet, this, _1)); - LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLIMWellWindow::findObjectChiclet, this, _1)); } LLIMWellWindow::~LLIMWellWindow() @@ -601,6 +599,10 @@ BOOL LLIMWellWindow::postBuild() { BOOL rv = LLSysWellWindow::postBuild(); setTitle(getString("title_im_well_window")); + + LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLIMWellWindow::findIMChiclet, this, _1)); + LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLIMWellWindow::findObjectChiclet, this, _1)); + return rv; } @@ -641,6 +643,8 @@ void LLIMWellWindow::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& notification_id) { + if (!mMessageList) return NULL; + LLChiclet* res = NULL; ObjectRowPanel* panel = mMessageList->getTypedItemByValue<ObjectRowPanel>(notification_id); if (panel != NULL) @@ -655,6 +659,8 @@ LLChiclet* LLIMWellWindow::findObjectChiclet(const LLUUID& notification_id) // PRIVATE METHODS LLChiclet* LLIMWellWindow::findIMChiclet(const LLUUID& sessionId) { + if (!mMessageList) return NULL; + LLChiclet* res = NULL; RowPanel* panel = mMessageList->getTypedItemByValue<RowPanel>(sessionId); if (panel != NULL) |