diff options
author | Graham Madarasz (Graham Linden) <graham@lindenlab.com> | 2013-08-23 14:44:46 -0700 |
---|---|---|
committer | Graham Madarasz (Graham Linden) <graham@lindenlab.com> | 2013-08-23 14:44:46 -0700 |
commit | 19726783cddb0ac3d34a510c083976e6f9661b49 (patch) | |
tree | 5e10d7178d88936475984ce7f5f109631fb2ea3a /indra | |
parent | 2b634d6c45d61f7132fc124e559347a736c6dfda (diff) |
MAINT-3046 make LLNotifications clear out vecs of LLNotificationChannelPtr so singleton cleanup doesn't do things it really ought not do
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcommon/llinitparam.h | 3 | ||||
-rwxr-xr-x | indra/llcommon/llinstancetracker.h | 1 | ||||
-rwxr-xr-x | indra/llui/llnotifications.cpp | 6 | ||||
-rwxr-xr-x | indra/llui/llnotifications.h | 7 | ||||
-rwxr-xr-x | indra/newview/llappviewer.cpp | 2 |
5 files changed, 17 insertions, 2 deletions
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index ae836645b9..b3b56321d3 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -1952,7 +1952,7 @@ namespace LLInitParam class Mandatory : public TypedParam<T, NAME_VALUE_LOOKUP, false> { typedef TypedParam<T, NAME_VALUE_LOOKUP, false> super_t; - typedef Mandatory<T, NAME_VALUE_LOOKUP> self_t; + typedef Mandatory<T, NAME_VALUE_LOOKUP> self_t; typedef typename super_t::value_t value_t; typedef typename super_t::default_value_t default_value_t; @@ -1980,6 +1980,7 @@ namespace LLInitParam static bool validate(const Param* p) { // valid only if provided + llassert(p); return static_cast<const self_t*>(p)->isProvided(); } diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 361182380a..7ef7d101db 100755 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -212,6 +212,7 @@ private: } void remove_() { + if (getMap_().find(mInstanceKey) != getMap_().end()) getMap_().erase(mInstanceKey); } diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 1789f003b9..0a79f2f588 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1125,7 +1125,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p) mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()) { BOOST_FOREACH(const std::string& source, p.sources) -{ + { connectToChannel(source); } } @@ -1209,6 +1209,10 @@ LLNotifications::LLNotifications() LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); } +void LLNotifications::clear() +{ + mDefaultChannels.clear(); +} // The expiration channel gets all notifications that are cancelled bool LLNotifications::expirationFilter(LLNotificationPtr pNotification) diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index cd3728305e..3b620084ee 100755 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -874,6 +874,13 @@ class LLNotifications : friend class LLSingleton<LLNotifications>; public: + + // Needed to clear up RefCounted things prior to actual destruction + // as the singleton nature of the class makes them do "bad things" + // on at least Mac, if not all 3 platforms + // + void clear(); + // load all notification descriptions from file // calling more than once will overwrite existing templates // but never delete a template diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1874cba4a4..75595f502f 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1614,6 +1614,8 @@ bool LLAppViewer::cleanup() //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; + LLNotifications::instance().clear(); + // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); |