diff options
| author | Oz Linden <oz@lindenlab.com> | 2013-10-23 13:05:59 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2013-10-23 13:05:59 -0400 |
| commit | c9775dde6249582f0e8976be15e72bfebc4ac3fc (patch) | |
| tree | 83407157dae234db649dfff763e68f6e3c843335 /indra/newview/lltoast.cpp | |
| parent | 1a72325ef1e8c798066d8ef7f82acd08d60fb68c (diff) | |
| parent | ea1e1b0925b386cf83178539b8eae9e25c573548 (diff) | |
merge up to 3.6.9-release
Diffstat (limited to 'indra/newview/lltoast.cpp')
| -rwxr-xr-x | indra/newview/lltoast.cpp | 42 |
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; + } +} + |
