Skip to content
Snippets Groups Projects
Commit 41e5bf34 authored by Richard Linden's avatar Richard Linden
Browse files

SH-4080 WIP interesting: random crash on Mac

fixed singleton unit test
resurrecting a singleton now properly calls initSingleton()
parent 215612bd
No related branches found
No related tags found
No related merge requests found
......@@ -136,21 +136,22 @@ class LLSingleton : private boost::noncopyable
case UNINITIALIZED:
// should never be uninitialized at this point
llassert(false);
break;
return NULL;
case CONSTRUCTING:
llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl;
break;
return NULL;
case INITIALIZING:
// go ahead and flag ourselves as initialized so we can be reentrant during initialization
sData.mInitState = INITIALIZED;
sData.mInstance->initSingleton();
return sData.mInstance;
break;
case INITIALIZED:
return sData.mInstance;
case DELETED:
llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl;
SingletonLifetimeManager::construct();
sData.mInitState = INITIALIZED;
sData.mInstance->initSingleton();
return sData.mInstance;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment