From e75519ef0e0a3b3aebf7761830b1e93163e3c673 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 31 May 2021 17:19:37 +0300 Subject: SL-15093 Crash nanov2_free_to_block #2 Mostly converted some boost pointers to std ones Made ~LLNotificationChannelBase() more explicit to get a bit more data on location of another crash that likely happens when cleaning mItems --- indra/llui/llnotificationptr.h | 3 +-- indra/llui/llnotifications.h | 21 +++++++++++++-------- indra/llui/llnotificationslistener.h | 3 +-- indra/llui/llnotificationtemplate.h | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotificationptr.h b/indra/llui/llnotificationptr.h index acc047527f..580f353c7d 100644 --- a/indra/llui/llnotificationptr.h +++ b/indra/llui/llnotificationptr.h @@ -27,9 +27,8 @@ // Many classes just store a single LLNotificationPtr // and llnotifications.h is very large, so define this ligher header. -#include class LLNotification; -typedef boost::shared_ptr LLNotificationPtr; +typedef std::shared_ptr LLNotificationPtr; #endif diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2f4578da17..4287bff059 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -84,8 +84,6 @@ #include #include -#include -#include #include #include #include @@ -132,7 +130,7 @@ public: typedef boost::function LLNotificationResponder; -typedef boost::shared_ptr LLNotificationResponderPtr; +typedef std::shared_ptr LLNotificationResponderPtr; typedef LLFunctorRegistry LLNotificationFunctorRegistry; typedef LLFunctorRegistration LLNotificationFunctorRegistration; @@ -276,19 +274,19 @@ private: bool mInvertSetting; }; -typedef boost::shared_ptr LLNotificationFormPtr; +typedef std::shared_ptr LLNotificationFormPtr; struct LLNotificationTemplate; // we want to keep a map of these by name, and it's best to manage them // with smart pointers -typedef boost::shared_ptr LLNotificationTemplatePtr; +typedef std::shared_ptr LLNotificationTemplatePtr; struct LLNotificationVisibilityRule; -typedef boost::shared_ptr LLNotificationVisibilityRulePtr; +typedef std::shared_ptr LLNotificationVisibilityRulePtr; /** * @class LLNotification @@ -304,7 +302,7 @@ typedef boost::shared_ptr LLNotificationVisibility */ class LLNotification : boost::noncopyable, - public boost::enable_shared_from_this + public std::enable_shared_from_this { LOG_CLASS(LLNotification); friend class LLNotifications; @@ -743,7 +741,14 @@ public: : mFilter(filter), mItems() {} - virtual ~LLNotificationChannelBase() {} + virtual ~LLNotificationChannelBase() + { + // explicit cleanup for easier issue detection + mChanged.disconnect_all_slots(); + mPassedFilter.disconnect_all_slots(); + mFailedFilter.disconnect_all_slots(); + mItems.clear(); + } // you can also connect to a Channel, so you can be notified of // changes to this channel LLBoundListener connectChanged(const LLEventListener& slot) diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h index f9f7641de6..4bab377626 100644 --- a/indra/llui/llnotificationslistener.h +++ b/indra/llui/llnotificationslistener.h @@ -31,7 +31,6 @@ #include "lleventapi.h" #include "llnotificationptr.h" -#include #include #include @@ -61,7 +60,7 @@ private: static LLSD asLLSD(LLNotificationPtr); class Forwarder; - typedef std::map > ForwarderMap; + typedef std::map > ForwarderMap; ForwarderMap mForwarders; LLNotifications & mNotifications; }; diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index 20cbc89ede..a8902486e4 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -31,7 +31,7 @@ #include "llinitparam.h" #include "llnotifications.h" -typedef boost::shared_ptr LLNotificationFormPtr; +typedef std::shared_ptr LLNotificationFormPtr; // This is the class of object read from the XML file (notifications.xml, // from the appropriate local language directory). -- cgit v1.2.3