summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-10-16 01:45:47 +0000
committerRichard Nelson <richard@lindenlab.com>2009-10-16 01:45:47 +0000
commitddef4292bd7446b7c8f7db76d03795f5d10a0788 (patch)
treea8ebcc56680e9612452da9b6fd7ae5de754f4364 /indra/llcommon
parent5d80277c573018727f3ce9b55c53a25894ea0046 (diff)
svn revert -r136312 llinstancetracker.h - reverted changed to instance tracker that won't work with llcommon.dll
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llinstancetracker.h15
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