From 27d25e7ae12e4c88c29cfb8efe887c681e3a6684 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 9 Mar 2011 18:20:08 -0800 Subject: SOCIAL-659 FIX Viewer crash when selecting report option from mini-inspector in minimal and standard skin --- indra/llui/llnotifications.cpp | 10 +++++++--- indra/newview/lltoast.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7708f2311e..3fac0ccb3a 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1195,16 +1195,18 @@ bool LLNotifications::uniqueFilter(LLNotificationPtr pNotif) bool LLNotifications::uniqueHandler(const LLSD& payload) { + std::string cmd = payload["sigtype"]; + LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID()); if (pNotif && pNotif->hasUniquenessConstraints()) { - if (payload["sigtype"].asString() == "add") + if (cmd == "add") { // not a duplicate according to uniqueness criteria, so we keep it // and store it for future uniqueness checks mUniqueNotifications.insert(std::make_pair(pNotif->getName(), pNotif)); } - else if (payload["sigtype"].asString() == "delete") + else if (cmd == "delete") { mUniqueNotifications.erase(pNotif->getName()); } @@ -1217,7 +1219,9 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload) { LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID()); - if (!pNotif) + std::string cmd = payload["sigtype"]; + + if (!pNotif || cmd != "add") { return false; } diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index fd5582d6f7..e0b07ed408 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -99,7 +99,6 @@ LLToast::Params::Params() LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), - mPanel(p.panel), mToastLifetime(p.lifetime_secs), mToastFadingTime(p.fading_time_secs), mNotificationID(p.notif_id), @@ -108,6 +107,7 @@ LLToast::LLToast(const LLToast::Params& p) mCanBeStored(p.can_be_stored), mHideBtnEnabled(p.enable_hide_btn), mHideBtn(NULL), + mPanel(NULL), mNotification(p.notification), mIsHidden(false), mHideBtnPressed(false), @@ -128,9 +128,9 @@ LLToast::LLToast(const LLToast::Params& p) setBackgroundOpaque(TRUE); // *TODO: obsolete updateTransparency(); - if(mPanel) + if(p.panel()) { - insertPanel(mPanel); + insertPanel(p.panel); } if(mHideBtnEnabled) @@ -309,6 +309,7 @@ void LLToast::reshapeToPanel() void LLToast::insertPanel(LLPanel* panel) { + mPanel = panel; mWrapperPanel->addChild(panel); reshapeToPanel(); } -- cgit v1.2.3