fix an exit crash.

meow-7.2.2
Xiaohong Bao 2011-01-06 16:48:00 -07:00
parent 611d8bdf61
commit 9434f0c2a0
1 changed files with 8 additions and 3 deletions

View File

@ -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) ;