From c4b77e247e595a843207a9121a0d20d9d2a515d5 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 23 Nov 2011 23:40:31 -0600 Subject: [PATCH] LLInstanceTracker v3 merge --- indra/llcommon/llinstancetracker.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index d0cfba406..0bf4c1bd5 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -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(this)); } virtual ~LLInstanceTracker()