diff options
author | simon <none@none> | 2013-04-24 15:34:18 -0700 |
---|---|---|
committer | simon <none@none> | 2013-04-24 15:34:18 -0700 |
commit | cc3361352df3463e9ba16e57c04cc35e65821f33 (patch) | |
tree | 3230c6cf2fe6de00ea5e80825877b1422930c082 /indra/newview | |
parent | faf844ff996f205af6eb6b2ebd5290594da8d142 (diff) |
Follow-up code cleaning for LLToast work trying to get branch healthy.
Reviewed by Kelly
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterimnearbychathandler.cpp | 13 | ||||
-rw-r--r-- | indra/newview/lltoast.cpp | 41 | ||||
-rw-r--r-- | indra/newview/lltoast.h | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 4 |
4 files changed, 49 insertions, 10 deletions
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 9ce5e12897..c4d7bbb7f6 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -187,14 +187,11 @@ void LLFloaterIMNearbyChatScreenChannel::deactivateToast(LLToast* toast) { toast_vec_t::iterator pos = std::find(m_active_toasts.begin(), m_active_toasts.end(), toast->getHandle()); - if (pos == m_active_toasts.end()) + if (pos != m_active_toasts.end()) { - llassert(pos == m_active_toasts.end()); - return; + LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; + m_active_toasts.erase(pos); } - - LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; - m_active_toasts.erase(pos); } void LLFloaterIMNearbyChatScreenChannel::createOverflowToast(S32 bottom, F32 timer) @@ -210,8 +207,8 @@ void LLFloaterIMNearbyChatScreenChannel::onToastDestroyed(LLToast* toast, bool a { // Viewer is quitting. // Immediately stop processing chat messages (EXT-1419). - mStopProcessing = true; -} + mStopProcessing = true; + } else { // The toast is being closed by user (STORM-192). diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index a26e47e1c8..4b60f49573 100644 --- 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); + } } //-------------------------------------------------------------------------- @@ -580,3 +592,28 @@ void LLToast::updateClass() toast.updateHoveredState(); } } + +// static +void LLToast::cleanupToasts() +{ + LL_CHECK_MEMORY; + + 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; + } +} + diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 5da7120e84..f02d7c2a1a 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -106,6 +106,7 @@ public: }; static void updateClass(); + static void cleanupToasts(); LLToast(const LLToast::Params& p); virtual ~LLToast(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bb71707db6..136e61389a 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -150,6 +150,7 @@ #include "lltexturecache.h" #include "lltexturefetch.h" #include "lltextureview.h" +#include "lltoast.h" #include "lltool.h" #include "lltoolbarview.h" #include "lltoolcomp.h" @@ -2035,6 +2036,9 @@ void LLViewerWindow::shutdownViews() } llinfos << "Global views cleaned." << llendl ; + LLNotificationsUI::LLToast::cleanupToasts();
+ llinfos << "Leftover toast cleaned up." << llendl;
+ // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. LLModalDialog::shutdownModals(); |