DRTVWR-418: Tweak shutdown sequence to avoid resurrecting singletons.

The LLSingletonBase::deleteAll() call late in LLAppViewer::cleanup() deletes
the LLSingleton(s) used by the logging machinery, among other things. Attempting
further logging after that call (such as our cheery "Goodbye!") has the
unfortunate effect of attempting to resurrect the deleted LLSingleton(s). Move
"Goodbye!" to just *before* the call.

Also, given that call, the manual references to a couple specific LLSingletons
in ~LLAppViewer() are (a) unnecessary and (b) cause attempted resurrection.
Eliminate both.
meow-7.2.2
Nat Goodspeed 2017-03-13 13:58:59 -04:00
parent d1ef2a7291
commit 04c3f2b0f0
1 changed files with 4 additions and 5 deletions

View File

@ -738,10 +738,7 @@ LLAppViewer::LLAppViewer()
LLAppViewer::~LLAppViewer()
{
delete mSettingsLocationList;
LLViewerEventRecorder::deleteSingleton();
LLLoginInstance::instance().setUpdaterService(0);
destroyMainloopTimeout();
// If we got to this destructor somehow, the app didn't hang.
@ -2110,6 +2107,10 @@ bool LLAppViewer::cleanup()
// realtime, or might throw an exception.
LLSingletonBase::cleanupAll();
// The logging subsystem depends on an LLSingleton. Any logging after
// LLSingletonBase::deleteAll() won't be recorded.
LL_INFOS() << "Goodbye!" << LL_ENDL;
// This calls every remaining LLSingleton's deleteSingleton() method.
// No class destructor should perform any cleanup that might take
// significant realtime, or throw an exception.
@ -2122,8 +2123,6 @@ bool LLAppViewer::cleanup()
// probably useful to be able to log that order.
LLSingletonBase::deleteAll();
LL_INFOS() << "Goodbye!" << LL_ENDL;
removeDumpDir();
// return 0;