diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 7558bf4fae8da30f2e71d65520fcea0b9fa8246e..40002313f186720e3c5f6ca85888f190d5e9a2f7 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -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; }