Fix for crash in LLPluginProcessParent during early shutdown.

fixes secondlife/viewer#2550
master
Brad Linden 2024-09-16 13:14:14 -07:00
parent 94453aecc3
commit e3c3cc636e
1 changed files with 7 additions and 1 deletions

View File

@ -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;