diff options
author | simon <none@none> | 2013-04-15 16:27:13 -0700 |
---|---|---|
committer | simon <none@none> | 2013-04-15 16:27:13 -0700 |
commit | 205938b652bc9218494835afadce095b29f1d19d (patch) | |
tree | 9f0a8301c258b0520c9ad7f06c54fa2c8b746450 /indra/llcommon | |
parent | c6991c9c75ff125654b68992c61a3c17c39bf5c5 (diff) |
Fix crash introduced by LLInstanceTrackerBase optimization. Reviewed by Kelly
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llinstancetracker.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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]; } |