From d78e22887482056e9e29cccf2b7a8a675035d040 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Sep 2008 18:27:37 -0500 Subject: Second Life viewer sources 1.21.1-RC --- linden/indra/newview/lltexturecache.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'linden/indra/newview/lltexturecache.cpp') diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index da23710..c9ad5a3 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/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; } -- cgit v1.1