LLInstanceTracker v3 merge

This commit is contained in:
Shyotl
2011-11-23 23:40:31 -06:00
parent 9f9daba33d
commit c4b77e247e

View File

@@ -194,7 +194,12 @@ public:
}
protected:
LLInstanceTracker(KEY key) { add_(key); }
LLInstanceTracker(KEY key)
{
// make sure static data outlives all instances
getStatic();
add_(key);
}
virtual ~LLInstanceTracker()
{
// it's unsafe to delete instances of this type while all instances are being iterated over.
@@ -282,7 +287,8 @@ public:
protected:
LLInstanceTracker()
{
// it's safe but unpredictable to create instances of this type while all instances are being iterated over. I hate unpredictable. This assert will probably be turned on early in the next development cycle.
// make sure static data outlives all instances
getStatic();
getSet_().insert(static_cast<T*>(this));
}
virtual ~LLInstanceTracker()