diff options
author | Baker Linden <baker@lindenlab.com> | 2013-12-18 18:25:47 -0500 |
---|---|---|
committer | Baker Linden <baker@lindenlab.com> | 2013-12-18 18:25:47 -0500 |
commit | 3c521d8207092f1c48e158082b88c5e81cc9c440 (patch) | |
tree | 36a18cfaed8fc4e3ee2a84604f3876832522e529 /indra/newview/lltoast.cpp | |
parent | 74707f0057c05dc4dd439302e64fe29e8ed91a32 (diff) | |
parent | 1a9b9f1bd1b5f64b35b9ce6eff458cdb7a79fe6e (diff) |
viewer-release merge
Diffstat (limited to 'indra/newview/lltoast.cpp')
-rwxr-xr-x | indra/newview/lltoast.cpp | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 9dfb29b905..448fae48de 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); + } } //-------------------------------------------------------------------------- @@ -543,7 +555,7 @@ BOOL LLToast::handleMouseDown(S32 x, S32 y, MASK mask) mHideBtnPressed = mHideBtn->getRect().pointInRect(x, y); } - return LLFloater::handleMouseDown(x, y, mask); + return LLModalDialog::handleMouseDown(x, y, mask); } //-------------------------------------------------------------------------- @@ -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; + } +} + |