From f06b305d9fe72b6972a2ab0d6047b792fa2706cd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 28 May 2014 16:16:09 -0700 Subject: ACME-1471 WIP [VWR] Merge multiple Exp Perm dialogs into one merged multiple experience toasts into a single one reviewed by Cho --- indra/newview/llscreenchannel.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview/llscreenchannel.cpp') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 6a840f3f40..0318199050 100755 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -533,19 +533,23 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) { std::vector::iterator it = find(mToastList.begin(), mToastList.end(), id); + LLPanel* panel_to_delete = panel; + if( it != mToastList.end() && panel) { LLToast* toast = it->getToast(); if (toast) { - LLPanel* old_panel = toast->getPanel(); - toast->removeChild(old_panel); - delete old_panel; - toast->insertPanel(panel); - toast->startTimer(); + LLPanel* old_panel = toast->getPanel(); + toast->removeChild(old_panel); + panel_to_delete = old_panel; + toast->insertPanel(panel); + toast->startTimer(); } redrawToasts(); } + + delete panel_to_delete; } //-------------------------------------------------------------------------- -- cgit v1.2.3