diff options
author | Richard Nelson <richard@lindenlab.com> | 2009-10-16 01:45:47 +0000 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2009-10-16 01:45:47 +0000 |
commit | ddef4292bd7446b7c8f7db76d03795f5d10a0788 (patch) | |
tree | a8ebcc56680e9612452da9b6fd7ae5de754f4364 | |
parent | 5d80277c573018727f3ce9b55c53a25894ea0046 (diff) |
svn revert -r136312 llinstancetracker.h - reverted changed to instance tracker that won't work with llcommon.dll
-rw-r--r-- | indra/llcommon/llinstancetracker.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index de25e364fa..ea50acbbc5 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -71,13 +71,17 @@ private: static std::map<KEY, T*>& getMap() { - static std::map<KEY, T*>* sInstances = new std::map<KEY, T*>(); + if (! sInstances) + { + sInstances = new std::map<KEY, T*>; + } return *sInstances; } private: KEY mKey; + static std::map<KEY, T*>* sInstances; }; // explicit specialization for default case where KEY is T* @@ -101,10 +105,17 @@ protected: static std::set<T*>& getSet() // called after getReady() but before go() { - static std::set<T*>* sInstances = new std::set<T*>(); + if (! sInstances) + { + sInstances = new std::set<T*>; + } return *sInstances; } + + static std::set<T*>* sInstances; }; +template <typename T, typename KEY> std::map<KEY, T*>* LLInstanceTracker<T, KEY>::sInstances = NULL; +template <typename T> std::set<T*>* LLInstanceTracker<T, T*>::sInstances = NULL; #endif |