diff options
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rw-r--r-- | indra/newview/lltexturecache.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index deb817d2ab..3d53eaa631 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -792,6 +792,14 @@ bool LLTextureCacheRemoteWorker::doWrite() //virtual bool LLTextureCacheWorker::doWork(S32 param) { + //allocate a new local apr_pool + LLAPRPool pool ; + + //save the current mFileAPRPool to avoid breaking anything. + apr_pool_t* old_pool = mCache->getFileAPRPool() ; + //make mFileAPRPool to point to the local one + mCache->setFileAPRPool(pool.getAPRPool()) ; + bool res = false; if (param == 0) // read { @@ -805,6 +813,10 @@ bool LLTextureCacheWorker::doWork(S32 param) { llassert_always(0); } + + //set mFileAPRPool back, the local one will be released automatically. + mCache->setFileAPRPool(old_pool) ; + return res; } |