diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-11-23 23:28:10 +0200 |
---|---|---|
committer | akleshchev <117672381+akleshchev@users.noreply.github.com> | 2023-11-24 15:15:10 +0200 |
commit | dce1fae986f4f61f51e7825de903aa58239c28c8 (patch) | |
tree | cd87bab800cfa7859f8cd3d6521de0666234308b /indra/llui/llnotifications.cpp | |
parent | a1fed466f0cc0c08d3cdcba88e02230c94e763b0 (diff) |
SL-17076 MacOS crash on clearing ChicletNotificationChannel
Crash appears to happens inside mItems.clear() of the
LLNotificationChannelBase, but there is no apparent reson for it and
stack jumped some steps, so I'm doing cleanup more explicitly to see
if it's indeed there and not a corruption somewhere earlier.
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r-- | indra/llui/llnotifications.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index d736aa6634..c0a7866926 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1171,6 +1171,14 @@ LLNotificationChannel::LLNotificationChannel(const std::string& name, connectToChannel(parent); } +LLNotificationChannel::~LLNotificationChannel() +{ + for (LLBoundListener &listener : mListeners) + { + listener.disconnect(); + } +} + bool LLNotificationChannel::isEmpty() const { return mItems.empty(); @@ -1213,14 +1221,14 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name ) { if (channel_name.empty()) { - LLNotifications::instance().connectChanged( - boost::bind(&LLNotificationChannelBase::updateItem, this, _1)); + mListeners.push_back(LLNotifications::instance().connectChanged( + boost::bind(&LLNotificationChannelBase::updateItem, this, _1))); } else { mParents.push_back(channel_name); LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name); - p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1)); + mListeners.push_back(p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1))); } } |