diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2026-04-07 20:28:54 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-07 20:28:54 -0400 |
| commit | 1d2cf48afa29b3b77a83cc1c7b85e56eaec8b95d (patch) | |
| tree | ab96511b5b2a7852ee328e7fc94d4a26f835d710 /indra/llcommon | |
| parent | 0a42b9f220c320b9cdc43987ff1f0d9871a4958b (diff) | |
| parent | 66dc10f0e9ab4f8d209f8a04671027c608daaffd (diff) | |
Merge pull request #5623 from secondlife/geenz/main-develop
26.1.1 -> develop
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/workqueue.cpp | 18 | ||||
| -rw-r--r-- | indra/llcommon/workqueue.h | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp index 67c23358ed..fbd92d089e 100644 --- a/indra/llcommon/workqueue.cpp +++ b/indra/llcommon/workqueue.cpp @@ -38,7 +38,8 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown) { // Register for "LLApp" events so we can implicitly close() on viewer shutdown std::string listener_name = "WorkQueue:" + getKey(); - LLEventPumps::instance().obtain("LLApp").listen( + LLEventPumps* pump = LLEventPumps::getInstance(); + pump->obtain("LLApp").listen( listener_name, [this](const LLSD& stat) { @@ -54,14 +55,25 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown) // Store the listener name so we can unregister in the destructor mListenerName = listener_name; + mPumpHandle = pump->getHandle(); } } LL::WorkQueueBase::~WorkQueueBase() { - if (!mListenerName.empty() && !LLEventPumps::wasDeleted()) + if (!mListenerName.empty() && !mPumpHandle.isDead()) { - LLEventPumps::instance().obtain("LLApp").stopListening(mListenerName); + // Due to shutdown order issues, use handle, not a singleton + // and ignore fiber issue. + try + { + LLEventPumps* pump = mPumpHandle.get(); + pump->obtain("LLApp").stopListening(mListenerName); + } + catch (const boost::fibers::lock_error&) + { + // Likely mutex is down, ignore + } } } diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h index 573203a5b3..69f3286c1b 100644 --- a/indra/llcommon/workqueue.h +++ b/indra/llcommon/workqueue.h @@ -14,6 +14,7 @@ #include "llcoros.h" #include "llexception.h" +#include "llhandle.h" #include "llinstancetracker.h" #include "llinstancetrackersubclass.h" #include "threadsafeschedule.h" @@ -22,6 +23,9 @@ #include <functional> // std::function #include <string> +class LLEventPumps; + + namespace LL { @@ -202,6 +206,8 @@ namespace LL // Name used for the LLApp event listener (empty if not registered) std::string mListenerName; + // Due to shutdown order issues, store by handle + LLHandle<LLEventPumps> mPumpHandle; }; /***************************************************************************** |
