diff options
author | Dave SIMmONs <simon@lindenlab.com> | 2011-06-29 11:36:19 -0700 |
---|---|---|
committer | Dave SIMmONs <simon@lindenlab.com> | 2011-06-29 11:36:19 -0700 |
commit | cc73cf15e6c2a361df278cb0b66c4d68c6acfbcd (patch) | |
tree | 27140b901d74acd106c5fc4c7a96a2e578635347 /indra/newview/llnearbychathandler.cpp | |
parent | 1fbf3e0ec297004879d766cad11c5e9e15b86d4b (diff) | |
parent | a300902494f76b9542c3978c2ca80726cefbc942 (diff) |
Merge latest from lindenlab/viewer-development
Diffstat (limited to 'indra/newview/llnearbychathandler.cpp')
-rw-r--r-- | indra/newview/llnearbychathandler.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index f157b20592..957b6d5f94 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -268,6 +268,9 @@ bool LLNearbyChatScreenChannel::createPoolToast() toast->setOnFadeCallback(boost::bind(&LLNearbyChatScreenChannel::onToastFade, this, _1)); + // If the toast gets somehow prematurely destroyed, deactivate it to prevent crash (STORM-1352). + toast->setOnToastDestroyedCallback(boost::bind(&LLNearbyChatScreenChannel::onToastDestroyed, this, _1, false)); + LL_DEBUGS("NearbyChat") << "Creating and pooling toast" << llendl; m_toast_pool.push_back(toast->getHandle()); return true; @@ -369,8 +372,10 @@ void LLNearbyChatScreenChannel::arrangeToasts() } } -int sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second) +static bool sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second) { + if (!first.get() || !second.get()) return false; // STORM-1352 + F32 v1 = first.get()->getTimeLeftToLive(); F32 v2 = second.get()->getTimeLeftToLive(); return v1 > v2; @@ -396,7 +401,11 @@ void LLNearbyChatScreenChannel::showToastsBottom() for(toast_vec_t::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it) { LLToast* toast = it->get(); - if (!toast) continue; + if (!toast) + { + llwarns << "NULL found in the active chat toasts list!" << llendl; + continue; + } S32 toast_top = bottom + toast->getRect().getHeight() + margin; |