summaryrefslogtreecommitdiff
path: root/indra/llcommon/llinstancetracker.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2011-10-31 16:26:09 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2011-10-31 16:26:09 -0400
commit09179d1346ccf2fa07b2dec6a72592beb3bd262f (patch)
tree86b28bc6c0322a9abe9721dd0a0aa6e104487926 /indra/llcommon/llinstancetracker.h
parent0f9dc968cfb702eba595213bbecd34375bd048c5 (diff)
parentf18cfe97750cc13374adab15636532fe0fbda19c (diff)
merge viewer-development to mesh-development
Diffstat (limited to 'indra/llcommon/llinstancetracker.h')
-rw-r--r--indra/llcommon/llinstancetracker.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h
index 5a3990a8df..34d841a4e0 100644
--- a/indra/llcommon/llinstancetracker.h
+++ b/indra/llcommon/llinstancetracker.h
@@ -193,7 +193,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.
@@ -281,7 +286,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()