diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2016-09-03 11:22:54 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2016-09-03 11:22:54 -0400 |
commit | 4af7e496b489aaddea60453f40fd422ef5381a2d (patch) | |
tree | 4680fa6ddb5551791b482155a168079d151b8e0a /indra/llcommon/llerror.cpp | |
parent | a05ee7324df475231d5b46a1ba6b20f23ce71d0f (diff) |
MAINT-5232: Make LLError::is_available() depend on both LLSingletons.
LLError machinery depends on two different LLSingletons. Its is_available()
function is primarily for LLSingleton itself to determine whether it is, or is
not, safe to log. Until both of LLError's LLSingletons have been constructed,
attempting to log LLSingleton operations could produce infinite recursion.
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rw-r--r-- | indra/llcommon/llerror.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 638cecb054..a34b50f816 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -414,11 +414,6 @@ namespace namespace LLError { - bool is_available() - { - return Globals::instanceExists(); - } - class SettingsConfig : public LLRefCount { friend class Settings; @@ -458,7 +453,7 @@ namespace LLError Settings(); SettingsConfigPtr getSettingsConfig(); - + void reset(); SettingsStoragePtr saveAndReset(); void restore(SettingsStoragePtr pSettingsStorage); @@ -466,7 +461,7 @@ namespace LLError private: SettingsConfigPtr mSettingsConfig; }; - + SettingsConfig::SettingsConfig() : LLRefCount(), mPrintLocation(false), @@ -501,26 +496,31 @@ namespace LLError { return mSettingsConfig; } - + void Settings::reset() { Globals::getInstance()->invalidateCallSites(); mSettingsConfig = new SettingsConfig(); } - + SettingsStoragePtr Settings::saveAndReset() { SettingsStoragePtr oldSettingsConfig(mSettingsConfig.get()); reset(); return oldSettingsConfig; } - + void Settings::restore(SettingsStoragePtr pSettingsStorage) { Globals::getInstance()->invalidateCallSites(); SettingsConfigPtr newSettingsConfig(dynamic_cast<SettingsConfig *>(pSettingsStorage.get())); mSettingsConfig = newSettingsConfig; } + + bool is_available() + { + return Settings::instanceExists() && Globals::instanceExists(); + } } namespace LLError |