summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.cpp
diff options
context:
space:
mode:
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.