MAINT-8183 Fixed some exit issues and crashes

Thu, 22 Feb 2018 15:23:14 +0200

author
andreykproductengine <andreykproductengine@lindenlab.com>
date
Thu, 22 Feb 2018 15:23:14 +0200
changeset 55302
b0b94907a8a6
parent 55301
601da0c3034f
child 55303
56683b7a4ee6

MAINT-8183 Fixed some exit issues and crashes

indra/llcommon/llthread.cpp file | annotate | diff | revisions
indra/llvfs/lllfsthread.cpp file | annotate | diff | revisions
indra/newview/llappviewer.cpp file | annotate | diff | revisions
indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
     1.1 --- a/indra/llcommon/llthread.cpp	Thu Feb 22 18:01:39 2018 +0200
     1.2 +++ b/indra/llcommon/llthread.cpp	Thu Feb 22 15:23:14 2018 +0200
     1.3 @@ -152,13 +152,16 @@
     1.4  
     1.5      //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
     1.6  
     1.7 -    // We're done with the run function, this thread is done executing now.
     1.8 -    //NB: we are using this flag to sync across threads...we really need memory barriers here
     1.9 -    threadp->mStatus = STOPPED;
    1.10  
    1.11      delete threadp->mRecorder;
    1.12      threadp->mRecorder = NULL;
    1.13  
    1.14 +    // We're done with the run function, this thread is done executing now.
    1.15 +    //NB: we are using this flag to sync across threads...we really need memory barriers here
    1.16 +    // Todo: add LLMutex per thread instead of flag?
    1.17 +    // We are using "while (mStatus != STOPPED) {ms_sleep();}" everywhere.
    1.18 +    threadp->mStatus = STOPPED;
    1.19 +
    1.20      return NULL;
    1.21  }
    1.22  
     2.1 --- a/indra/llvfs/lllfsthread.cpp	Thu Feb 22 18:01:39 2018 +0200
     2.2 +++ b/indra/llvfs/lllfsthread.cpp	Thu Feb 22 15:23:14 2018 +0200
     2.3 @@ -52,13 +52,14 @@
     2.4  //static
     2.5  void LLLFSThread::cleanupClass()
     2.6  {
     2.7 +	llassert(sLocal != NULL);
     2.8  	sLocal->setQuitting();
     2.9  	while (sLocal->getPending())
    2.10  	{
    2.11  		sLocal->update(0);
    2.12  	}
    2.13  	delete sLocal;
    2.14 -	sLocal = 0;
    2.15 +	sLocal = NULL;
    2.16  }
    2.17  
    2.18  //----------------------------------------------------------------------------
    2.19 @@ -75,6 +76,7 @@
    2.20  
    2.21  LLLFSThread::~LLLFSThread()
    2.22  {
    2.23 +	// mLocalAPRFilePoolp cleanup in LLThread
    2.24  	// ~LLQueuedThread() will be called here
    2.25  }
    2.26  
     3.1 --- a/indra/newview/llappviewer.cpp	Thu Feb 22 18:01:39 2018 +0200
     3.2 +++ b/indra/newview/llappviewer.cpp	Thu Feb 22 15:23:14 2018 +0200
     3.3 @@ -1645,7 +1645,10 @@
     3.4  	LLEventPumps::instance().reset();
     3.5  
     3.6  	//dump scene loading monitor results
     3.7 -	LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
     3.8 +	if (LLSceneMonitor::instanceExists())
     3.9 +	{
    3.10 +		LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
    3.11 +	}
    3.12  
    3.13  	// There used to be an 'if (LLFastTimerView::sAnalyzePerformance)' block
    3.14  	// here, completely redundant with the one that occurs later in this same
    3.15 @@ -1687,8 +1690,11 @@
    3.16      // Give any remaining SLPlugin instances a chance to exit cleanly.
    3.17      LLPluginProcessParent::shutdown();
    3.18  
    3.19 -	LLVoiceClient::getInstance()->terminate();
    3.20 -	
    3.21 +	if (LLVoiceClient::instanceExists())
    3.22 +	{
    3.23 +		LLVoiceClient::getInstance()->terminate();
    3.24 +	}
    3.25 +
    3.26  	disconnectViewer();
    3.27  
    3.28  	LL_INFOS() << "Viewer disconnected" << LL_ENDL;
    3.29 @@ -1743,7 +1749,10 @@
    3.30  
    3.31  	// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted.
    3.32  
    3.33 -	LLWorldMap::getInstance()->reset(); // release any images
    3.34 +	if (LLWorldMap::instanceExists())
    3.35 +	{
    3.36 +		LLWorldMap::getInstance()->reset(); // release any images
    3.37 +	}
    3.38  
    3.39  	LLCalc::cleanUp();
    3.40  
    3.41 @@ -1916,10 +1925,16 @@
    3.42  	LLURLHistory::saveFile("url_history.xml");
    3.43  
    3.44  	// save mute list. gMuteList used to also be deleted here too.
    3.45 -	LLMuteList::getInstance()->cache(gAgent.getID());
    3.46 +	if (gAgent.isInitialized() && LLMuteList::instanceExists())
    3.47 +	{
    3.48 +		LLMuteList::getInstance()->cache(gAgent.getID());
    3.49 +	}
    3.50  
    3.51  	//save call log list
    3.52 -	LLConversationLog::instance().cache();
    3.53 +	if (LLConversationLog::instanceExists())
    3.54 +	{
    3.55 +		LLConversationLog::instance().cache();
    3.56 +	}
    3.57  
    3.58  	if (mPurgeOnExit)
    3.59  	{
     4.1 --- a/indra/newview/llmeshrepository.cpp	Thu Feb 22 18:01:39 2018 +0200
     4.2 +++ b/indra/newview/llmeshrepository.cpp	Thu Feb 22 15:23:14 2018 +0200
     4.3 @@ -836,6 +836,12 @@
     4.4  	mHttpRequestSet.clear();
     4.5      mHttpHeaders.reset();
     4.6  
     4.7 +    while (!mDecompositionQ.empty())
     4.8 +    {
     4.9 +        delete mDecompositionQ.front();
    4.10 +        mDecompositionQ.pop_front();
    4.11 +    }
    4.12 +
    4.13      delete mHttpRequest;
    4.14  	mHttpRequest = NULL;
    4.15  	delete mMutex;
    4.16 @@ -1941,6 +1947,9 @@
    4.17  {
    4.18  	delete mHttpRequest;
    4.19  	mHttpRequest = NULL;
    4.20 +	delete mMutex;
    4.21 +	mMutex = NULL;
    4.22 +
    4.23  }
    4.24  
    4.25  LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread)
    4.26 @@ -3321,6 +3330,7 @@
    4.27  
    4.28  LLMeshRepository::LLMeshRepository()
    4.29  : mMeshMutex(NULL),
    4.30 +  mDecompThread(NULL),
    4.31    mMeshThreadCount(0),
    4.32    mThread(NULL)
    4.33  {
    4.34 @@ -3350,6 +3360,8 @@
    4.35  void LLMeshRepository::shutdown()
    4.36  {
    4.37  	LL_INFOS(LOG_MESH) << "Shutting down mesh repository." << LL_ENDL;
    4.38 +	llassert(mThread != NULL);
    4.39 +	llassert(mThread->mSignal != NULL);
    4.40  
    4.41  	metrics_teleport_started_signal.disconnect();
    4.42  

mercurial