diff options
author | Oz Linden <oz@lindenlab.com> | 2011-06-29 12:10:03 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-06-29 12:10:03 -0400 |
commit | 290423764dc48e70205cc0d28187d9d8fe3c8dff (patch) | |
tree | 89a5814cb8aa25d1ead942b5e0221df5e7e832fe /indra/newview/llnearbychathandler.cpp | |
parent | b5be90d0d2f26792f0044286f9b64126446dc101 (diff) | |
parent | a300902494f76b9542c3978c2ca80726cefbc942 (diff) |
merge out latest 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 11dc496311..68c8d5854e 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; |