summaryrefslogtreecommitdiff
path: root/indra/llplugin
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2024-09-16 13:14:14 -0700
committerBrad Linden <brad@lindenlab.com>2024-09-16 13:14:14 -0700
commite3c3cc636e66043fa89f402c9f132c208f0217cd (patch)
tree0cd59a2c74cea6502fd13f63ea59d9c0d434dda9 /indra/llplugin
parent94453aecc352613f52fec0e59b23230314cffb32 (diff)
Fix for crash in LLPluginProcessParent during early shutdown.
fixes secondlife/viewer#2550
Diffstat (limited to 'indra/llplugin')
-rw-r--r--indra/llplugin/llpluginprocessparent.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index bd1e19c294..908f3c8ff5 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -48,7 +48,7 @@ LLPluginProcessParentOwner::~LLPluginProcessParentOwner()
bool LLPluginProcessParent::sUseReadThread = false;
apr_pollset_t *LLPluginProcessParent::sPollSet = NULL;
bool LLPluginProcessParent::sPollsetNeedsRebuild = false;
-LLCoros::Mutex *LLPluginProcessParent::sInstancesMutex;
+LLCoros::Mutex *LLPluginProcessParent::sInstancesMutex = nullptr;
LLPluginProcessParent::mapInstances_t LLPluginProcessParent::sInstances;
LLThread *LLPluginProcessParent::sReadThread = NULL;
@@ -155,6 +155,12 @@ LLPluginProcessParent::ptr_t LLPluginProcessParent::create(LLPluginProcessParent
/*static*/
void LLPluginProcessParent::shutdown()
{
+ if (!sInstancesMutex)
+ {
+ // setup was not complete, skip shutdown
+ return;
+ }
+
LLCoros::LockType lock(*sInstancesMutex);
mapInstances_t::iterator it;