diff options
author | Josh Bell <josh@lindenlab.com> | 2007-06-12 21:41:54 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-06-12 21:41:54 +0000 |
commit | 680667d4bdca7e2a6df15cd6f16f34c12c97da8e (patch) | |
tree | 9550001d7fa9cd708edb7076e426d87a3ab189d1 /indra/llcommon | |
parent | 65c038685f18eb8f70756e584482d7f97fa8c383 (diff) |
svn merge -r 62560:62559 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance
Revert bad patch for VWR-849 / SL-43759
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llerror.cpp | 50 | ||||
-rw-r--r-- | indra/llcommon/llerror.h | 3 |
2 files changed, 8 insertions, 45 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 4f8dc51458..3d9a51ecad 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -228,7 +228,7 @@ namespace LOG_CLASS(LogControlFile); public: - static LogControlFile *fromDirectory(const std::string& dir); + static LogControlFile& fromDirectory(const std::string& dir); virtual void loadFile(); @@ -238,7 +238,7 @@ namespace { } }; - LogControlFile *LogControlFile::fromDirectory(const std::string& dir) + LogControlFile& LogControlFile::fromDirectory(const std::string& dir) { std::string dirBase = dir + "/"; // NB: We have no abstraction in llcommon for the "proper" @@ -254,7 +254,8 @@ namespace file = dirBase + "logcontrol.xml"; } - return new LogControlFile(file); + return * new LogControlFile(file); + // NB: This instance is never freed } void LogControlFile::loadFile() @@ -298,11 +299,8 @@ namespace static Globals& get(); // return the one instance of the globals - static void Globals::cleanup(); - private: CallSiteVector callSites; - static Globals *sGlobals; Globals() : messageStreamInUse(false) @@ -310,8 +308,6 @@ namespace }; - Globals *Globals::sGlobals; - void Globals::addCallSite(LLError::CallSite& site) { callSites.push_back(&site); @@ -337,16 +333,8 @@ namespace is. See C++ FAQ Lite, sections 10.12 through 10.14 */ - if (sGlobals == NULL) { - sGlobals = new Globals; - } - - return *sGlobals; - } - - void Globals::cleanup() - { - delete sGlobals; + static Globals* globals = new Globals; + return *globals; } } @@ -374,7 +362,6 @@ namespace LLError int shouldLogCallCounter; static Settings& get(); - static void cleanup(); static void reset(); static Settings* saveAndReset(); @@ -411,16 +398,6 @@ namespace LLError return *p; } - void Settings::cleanup() - { - Settings*& ptr = getPtr(); - if (ptr) - { - delete ptr; - ptr = NULL; - } - } - void Settings::reset() { Globals::get().invalidateCallSites(); @@ -499,8 +476,6 @@ namespace } - static LogControlFile *gLogControlFile; - void commonInit(const std::string& dir) { LLError::Settings::reset(); @@ -518,8 +493,8 @@ namespace LLError::addRecorder(new RecordToWinDebug); #endif - gLogControlFile = LogControlFile::fromDirectory(dir); - gLogControlFile->addToEventTimer(); + LogControlFile& e = LogControlFile::fromDirectory(dir); + e.addToEventTimer(); } } @@ -543,15 +518,6 @@ namespace LLError commonInit(dir); } - void cleanupLogging(void) - { - delete gLogControlFile; - gLogControlFile = NULL; - - Settings::cleanup(); - Globals::cleanup(); - } - void setPrintLocation(bool print) { Settings& s = Settings::get(); diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index d32469d0c2..84ac0fa7f0 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -152,9 +152,6 @@ namespace LLError class NoClassInfo { }; // used to indicate no class info known for logging - - void cleanupLogging(); - // after this is called, no more logging is allowed } |