@@ -193,7 +193,12 @@ class LLInstanceTracker : public LLInstanceTrackerBase
...
@@ -193,7 +193,12 @@ class LLInstanceTracker : public LLInstanceTrackerBase
}
}
protected:
protected:
LLInstanceTracker(KEYkey){add_(key);}
LLInstanceTracker(KEYkey)
{
// make sure static data outlives all instances
getStatic();
add_(key);
}
virtual~LLInstanceTracker()
virtual~LLInstanceTracker()
{
{
// it's unsafe to delete instances of this type while all instances are being iterated over.
// it's unsafe to delete instances of this type while all instances are being iterated over.
...
@@ -281,7 +286,8 @@ class LLInstanceTracker<T, T*> : public LLInstanceTrackerBase
...
@@ -281,7 +286,8 @@ class LLInstanceTracker<T, T*> : public LLInstanceTrackerBase
protected:
protected:
LLInstanceTracker()
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.