diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2011-01-06 16:48:00 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2011-01-06 16:48:00 -0700 |
commit | 9434f0c2a0e46c580a2aacc04cc1b58876bd3bd8 (patch) | |
tree | 631e2bda50d830bfda3b673333978553bbf16579 /indra/llcommon/llmemory.cpp | |
parent | 611d8bdf6155f6c7b440ab745f197d278a74b209 (diff) |
fix an exit crash.
Diffstat (limited to 'indra/llcommon/llmemory.cpp')
-rw-r--r-- | indra/llcommon/llmemory.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index f1285841b3..1f40f5e17a 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -1248,13 +1248,18 @@ S32 LLPrivateMemoryPool::getChunkIndex(U32 size) void LLPrivateMemoryPool::destroyPool() { lock() ; - for(U32 i = 0 ; i < mHashFactor; i++) + if(mNumOfChunks > 0) { - while(mChunkHashList[i]) + for(U32 i = 0 ; i < mHashFactor; i++) { - removeChunk(mChunkHashList[i]) ; + while(mChunkHashList[i]) + { + removeChunk(mChunkHashList[i]) ; + } } } + mChunkHashList.clear() ; + mHashFactor = 1 ; llassert_always(mNumOfChunks == 0) ; llassert_always(mReservedPoolSize == 0) ; |