summaryrefslogtreecommitdiff
path: root/indra/newview/lltoast.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-09-26 11:44:40 -0700
committerGraham Linden <graham@lindenlab.com>2013-09-26 11:44:40 -0700
commit0103cac1ddda96fd470238d2c8b73c2cf55b6c12 (patch)
treea485d28fd9861c41bf9b7117c085bd84617f43de /indra/newview/lltoast.cpp
parentdd4beb695a9c800b37b7c9a19d3ac3f4456012f5 (diff)
parentbadb8a945d31aed6f396e7efb521e76083870069 (diff)
Merge viewer-bear maint RC changes to get this build closer to the RC it will follow
Diffstat (limited to 'indra/newview/lltoast.cpp')
-rwxr-xr-xindra/newview/lltoast.cpp42
1 files changed, 39 insertions, 3 deletions
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 9dfb29b905..d876c9a3f4 100755
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -173,8 +173,20 @@ void LLToast::setHideButtonEnabled(bool enabled)
//--------------------------------------------------------------------------
LLToast::~LLToast()
-{
- mOnToastDestroyedSignal(this);
+{
+ if(LLApp::isQuitting())
+ {
+ mOnFadeSignal.disconnect_all_slots();
+ mOnDeleteToastSignal.disconnect_all_slots();
+ mOnToastDestroyedSignal.disconnect_all_slots();
+ mOnToastHoverSignal.disconnect_all_slots();
+ mToastMouseEnterSignal.disconnect_all_slots();
+ mToastMouseLeaveSignal.disconnect_all_slots();
+ }
+ else
+ {
+ mOnToastDestroyedSignal(this);
+ }
}
//--------------------------------------------------------------------------
@@ -572,10 +584,34 @@ S32 LLToast::notifyParent(const LLSD& info)
//static
void LLToast::updateClass()
{
- for (LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances(); iter != LLInstanceTracker<LLToast>::endInstances(); )
+ for (LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances();
+ iter != LLInstanceTracker<LLToast>::endInstances(); )
{
LLToast& toast = *iter++;
toast.updateHoveredState();
}
}
+
+// static
+void LLToast::cleanupToasts()
+{
+ LLToast * toastp = NULL;
+
+ while (LLInstanceTracker<LLToast>::instanceCount() > 0)
+ {
+ { // Need to scope iter to allow deletion
+ LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances();
+ toastp = &(*iter);
+ }
+
+ //llinfos << "Cleaning up toast id " << toastp->getNotificationID() << llendl;
+
+ // LLToast destructor will remove it from the LLInstanceTracker.
+ if (!toastp)
+ break; // Don't get stuck in the loop if a null pointer somehow got on the list
+
+ delete toastp;
+ }
+}
+