diff options
Diffstat (limited to 'linden/indra/newview/lltexturecache.cpp')
-rw-r--r-- | linden/indra/newview/lltexturecache.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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() | |||
792 | //virtual | 792 | //virtual |
793 | bool LLTextureCacheWorker::doWork(S32 param) | 793 | bool LLTextureCacheWorker::doWork(S32 param) |
794 | { | 794 | { |
795 | //allocate a new local apr_pool | ||
796 | LLAPRPool pool ; | ||
797 | |||
798 | //save the current mFileAPRPool to avoid breaking anything. | ||
799 | apr_pool_t* old_pool = mCache->getFileAPRPool() ; | ||
800 | //make mFileAPRPool to point to the local one | ||
801 | mCache->setFileAPRPool(pool.getAPRPool()) ; | ||
802 | |||
795 | bool res = false; | 803 | bool res = false; |
796 | if (param == 0) // read | 804 | if (param == 0) // read |
797 | { | 805 | { |
@@ -805,6 +813,10 @@ bool LLTextureCacheWorker::doWork(S32 param) | |||
805 | { | 813 | { |
806 | llassert_always(0); | 814 | llassert_always(0); |
807 | } | 815 | } |
816 | |||
817 | //set mFileAPRPool back, the local one will be released automatically. | ||
818 | mCache->setFileAPRPool(old_pool) ; | ||
819 | |||
808 | return res; | 820 | return res; |
809 | } | 821 | } |
810 | 822 | ||