diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llevents.cpp | 9 | ||||
-rw-r--r-- | indra/llcommon/llevents.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 99abb333bb..186e710c43 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -602,6 +602,11 @@ LLBoundListener LLEventMailDrop::listen_impl(const std::string& name, return LLEventStream::listen_impl(name, listener, after, before); } +void LLEventMailDrop::discard() +{ + mEventHistory.clear(); + LLEventStream::flush(); +} /***************************************************************************** * LLEventQueue @@ -621,8 +626,8 @@ bool LLEventQueue::post(const LLSD& event) void LLEventQueue::flush() { - if(!mSignal) return; - + if(!mSignal) return; + // Consider the case when a given listener on this LLEventQueue posts yet // another event on the same queue. If we loop over mEventQueue directly, // we'll end up processing all those events during the same flush() call diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 3c388bf176..ce2aa2f3c9 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -610,7 +610,8 @@ public: virtual bool post(const LLSD& event) override; /// Remove any history stored in the mail drop. - virtual void flush() override { mEventHistory.clear(); LLEventStream::flush(); }; + void discard(); + protected: virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&, const NameList& after, |