summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturecache.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-09-01 13:40:10 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-09-01 13:40:10 -0600
commite29f811d56a283a32b490bec5bdcd1b0293a8986 (patch)
tree891ac772c0a7f6d07a6609c4e30c3a8ff758672f /indra/newview/lltexturecache.cpp
parent2969599880f898219700aa0e314a870e6e480178 (diff)
code for DEV-52939: viewer's object geometry cache files are not limited in number, and can also be incorrectly cleared with the VFS cache.
reviewed by andrew.
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rw-r--r--indra/newview/lltexturecache.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 2fd0a22f80..6a213309a0 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -927,7 +927,7 @@ void LLTextureCache::setReadOnly(BOOL read_only)
}
//called in the main thread.
-S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL disable_texture_cache)
+S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache_mismatch)
{
llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized.
@@ -942,20 +942,23 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL disable_textu
sCacheMaxTexturesSize = max_size;
max_size -= sCacheMaxTexturesSize;
- if(disable_texture_cache) //the texture cache is disabled
- {
- llinfos << "The texture cache is disabled!" << llendl ;
- setReadOnly(TRUE) ;
- purgeAllTextures(true);
-
- return max_size ;
- }
-
LL_INFOS("TextureCache") << "Headers: " << sCacheMaxEntries
<< " Textures size: " << sCacheMaxTexturesSize/(1024*1024) << " MB" << LL_ENDL;
setDirNames(location);
+ if(texture_cache_mismatch)
+ {
+ //if readonly, disable the texture cache,
+ //otherwise wipe out the texture cache.
+ purgeAllTextures(true);
+
+ if(mReadOnly)
+ {
+ return max_size ;
+ }
+ }
+
if (!mReadOnly)
{
LLFile::mkdir(mTexturesDirName);