diff options
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llscreenchannel.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 154555b261..8708fb87ee 100644..100755 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -49,10 +49,10 @@ using namespace LLNotificationsUI; bool LLScreenChannel::mWasStartUpToastShown = false; -LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel Region"); +LLTrace::BlockTimerStatHandle FTM_GET_CHANNEL_RECT("Calculate Notification Channel Region"); LLRect LLScreenChannelBase::getChannelRect() { - LLFastTimer _(FTM_GET_CHANNEL_RECT); + LL_RECORD_BLOCK_TIME(FTM_GET_CHANNEL_RECT); if (mFloaterSnapRegion == NULL) { @@ -273,6 +273,14 @@ void LLScreenChannel::addToast(const LLToast::Params& p) // only cancel notification if it isn't being used in IM session LLNotifications::instance().cancel(notification); } + + // It was assumed that the toast would take ownership of the panel pointer. + // But since we have decided not to display the toast, kill the panel to + // prevent the memory leak. + if (p.panel != NULL) + { + p.panel()->die(); + } return; } @@ -599,7 +607,7 @@ void LLScreenChannel::showToastsBottom() LLToast* toast = (it-1)->getToast(); if (!toast) { - llwarns << "Attempt to display a deleted toast." << llendl; + LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL; return; } @@ -610,7 +618,7 @@ void LLScreenChannel::showToastsBottom() LLToast* toast = it->getToast(); if(!toast) { - llwarns << "Attempt to display a deleted toast." << llendl; + LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL; return; } @@ -698,7 +706,7 @@ void LLScreenChannel::showToastsCentre() LLToast* toast = mToastList[0].getToast(); if (!toast) { - llwarns << "Attempt to display a deleted toast." << llendl; + LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL; return; } @@ -711,7 +719,7 @@ void LLScreenChannel::showToastsCentre() LLToast* toast = it->getToast(); if (!toast) { - llwarns << "Attempt to display a deleted toast." << llendl; + LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL; return; } @@ -730,7 +738,6 @@ void LLScreenChannel::showToastsTop() LLRect toast_rect; S32 top = channel_rect.mTop; - S32 toast_margin = 0; std::vector<ToastElem>::reverse_iterator it; updateRect(); @@ -748,18 +755,18 @@ void LLScreenChannel::showToastsTop() LLToast* toast = (it-1)->getToast(); if (!toast) { - llwarns << "Attempt to display a deleted toast." << llendl; + LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL; return; } top = toast->getRect().mBottom - toast->getTopPad(); - toast_margin = gSavedSettings.getS32("ToastGap"); + gSavedSettings.getS32("ToastGap"); } LLToast* toast = it->getToast(); if (!toast) { - llwarns << "Attempt to display a deleted toast." << llendl; + LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL; return; } @@ -955,7 +962,7 @@ void LLScreenChannel::hideToastsFromScreen() } else { - llwarns << "Attempt to hide a deleted toast." << llendl; + LL_WARNS() << "Attempt to hide a deleted toast." << LL_ENDL; } } } @@ -973,7 +980,7 @@ void LLScreenChannel::hideToast(const LLUUID& notification_id) } else { - llwarns << "Attempt to hide a deleted toast." << llendl; + LL_WARNS() << "Attempt to hide a deleted toast." << LL_ENDL; } } } |