From 205938b652bc9218494835afadce095b29f1d19d Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 16:27:13 -0700 Subject: Fix crash introduced by LLInstanceTrackerBase optimization. Reviewed by Kelly --- indra/llcommon/llinstancetracker.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llinstancetracker.cpp') diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 65ef4322f6..89430f82d7 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,7 +32,9 @@ // external library headers // other Linden headers -static void* sInstanceTrackerData[ kInstanceTrackTypeCount ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static bool sInstanceTrackerData_initialized = false; +static void* sInstanceTrackerData[ kInstanceTrackTypeCount ]; + void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) { @@ -41,6 +43,15 @@ void * & LLInstanceTrackerBase::getInstances(InstanceTrackType t) // the pair and returns a std::pair of (iterator, true). If the specified // key DOES exist, insert() simply returns (iterator, false). One lookup // handles both cases. + if (!sInstanceTrackerData_initialized) + { + for (S32 i = 0; i < (S32) kInstanceTrackTypeCount; i++) + { + sInstanceTrackerData[i] = NULL; + } + sInstanceTrackerData_initialized = true; + } + return sInstanceTrackerData[t]; } -- cgit v1.2.3