diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2017-06-20 16:11:33 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2017-06-20 16:11:33 -0400 |
commit | a3066b7375a13b61861b554519673dfc24322c22 (patch) | |
tree | 9b3d61c932ff8a88e5a2384f138e7ed9b83248ac /indra/llcommon/llevents.h | |
parent | f1e52656e9e328d66aa5050bc9e59948a0217283 (diff) | |
parent | 124d8c8dce3a5da8aa73f12f8733c65f57479a24 (diff) |
Automated merge with ssh://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/llcommon/llevents.h')
-rw-r--r-- | indra/llcommon/llevents.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 7cff7dfd45..1d51c660ed 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -62,6 +62,7 @@ #include "lldependencies.h" #include "llstl.h" #include "llexception.h" +#include "llhandle.h" /*==========================================================================*| // override this to allow binding free functions with more parameters @@ -227,7 +228,15 @@ class LLEventPump; * LLEventPumps is a Singleton manager through which one typically accesses * this subsystem. */ -class LL_COMMON_API LLEventPumps: public LLSingleton<LLEventPumps> +// LLEventPumps isa LLHandleProvider only for (hopefully rare) long-lived +// class objects that must refer to this class late in their lifespan, say in +// the destructor. Specifically, the case that matters is a possible reference +// after LLEventPumps::deleteSingleton(). (Lingering LLEventPump instances are +// capable of this.) In that case, instead of calling LLEventPumps::instance() +// again -- resurrecting the deleted LLSingleton -- store an +// LLHandle<LLEventPumps> and test it before use. +class LL_COMMON_API LLEventPumps: public LLSingleton<LLEventPumps>, + public LLHandleProvider<LLEventPumps> { LLSINGLETON(LLEventPumps); public: @@ -590,6 +599,9 @@ private: return this->listen_impl(name, listener, after, before); } + // must precede mName; see LLEventPump::LLEventPump() + LLHandle<LLEventPumps> mRegistry; + std::string mName; protected: @@ -817,14 +829,14 @@ public: mConnection(new LLBoundListener) { } - + /// Copy constructor. Copy shared_ptrs to original instance data. LLListenerWrapperBase(const LLListenerWrapperBase& that): mName(that.mName), mConnection(that.mConnection) { } - virtual ~LLListenerWrapperBase() {} + virtual ~LLListenerWrapperBase() {} /// Ask LLEventPump::listen() for the listener name virtual void accept_name(const std::string& name) const |