summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-11-19 04:45:15 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-11-19 04:45:15 +0200
commit49dd88e86c8e5939fbd82d5a5316c36ade262ca2 (patch)
treef66707306782df4229657cdc4fb25fe70ab0bd18 /indra/llcommon/llevents.cpp
parent5649bb0c2297e4597fd2c904f0e8bb3db8051240 (diff)
parent9957c28ddc5e5c129af2db662da7d69f1509af65 (diff)
Merge branch 'master' into DRTVWR-540-maint
# Conflicts: # indra/newview/llfloatereditextdaycycle.cpp # indra/newview/llviewerinput.cpp
Diffstat (limited to 'indra/llcommon/llevents.cpp')
-rw-r--r--indra/llcommon/llevents.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 64fb985951..0a213bddef 100644
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -45,7 +45,6 @@
#include <cctype>
// external library headers
#include <boost/range/iterator_range.hpp>
-#include <boost/make_shared.hpp>
#if LL_WINDOWS
#pragma warning (push)
#pragma warning (disable : 4701) // compiler thinks might use uninitialized var, but no
@@ -285,7 +284,7 @@ LLEventPump::LLEventPump(const std::string& name, bool tweak):
// Register every new instance with LLEventPumps
mRegistry(LLEventPumps::instance().getHandle()),
mName(mRegistry.get()->registerNew(*this, name, tweak)),
- mSignal(boost::make_shared<LLStandardSignal>()),
+ mSignal(std::make_shared<LLStandardSignal>()),
mEnabled(true)
{}
@@ -317,14 +316,24 @@ void LLEventPump::clear()
{
// Destroy the original LLStandardSignal instance, replacing it with a
// whole new one.
- mSignal = boost::make_shared<LLStandardSignal>();
+ mSignal = std::make_shared<LLStandardSignal>();
mConnections.clear();
}
void LLEventPump::reset()
{
- mSignal.reset();
+ // Resetting mSignal is supposed to disconnect everything on its own
+ // But due to crash on 'reset' added explicit cleanup to get more data
+ ConnectionMap::const_iterator iter = mConnections.begin();
+ ConnectionMap::const_iterator end = mConnections.end();
+ while (iter!=end)
+ {
+ iter->second.disconnect();
+ iter++;
+ }
mConnections.clear();
+
+ mSignal.reset();
//mDeps.clear();
}
@@ -543,7 +552,7 @@ bool LLEventStream::post(const LLSD& event)
// *stack* instance of the shared_ptr, ensuring that our heap
// LLStandardSignal object will live at least until post() returns, even
// if 'this' gets destroyed during the call.
- boost::shared_ptr<LLStandardSignal> signal(mSignal);
+ std::shared_ptr<LLStandardSignal> signal(mSignal);
// Let caller know if any one listener handled the event. This is mostly
// useful when using LLEventStream as a listener for an upstream
// LLEventPump.