summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-10-26 11:10:18 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-10-26 11:10:18 -0600
commitfa04683aba24c1a5dc9dabd77b8c5fabef492974 (patch)
tree98a20dc0f79f856d177d8478b33d0b9919058d6a /indra/newview
parent0637fe27bc9f07208a1703349a304b27fc08a535 (diff)
fix for SH-2573: Flaw in Purging Texture Cache when it Exceeds Limit
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltexturecache.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 87b6304f9d..d9da9eb476 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1633,8 +1633,8 @@ void LLTextureCache::purgeTextures(bool validate)
{
purge_count++;
LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL;
- removeEntry(idx, entries[idx], filename) ;
cache_size -= entries[idx].mBodySize;
+ removeEntry(idx, entries[idx], filename) ;
}
}
@@ -1871,13 +1871,12 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename)
file_maybe_exists = false;
}
}
+ mTexturesSizeTotal -= entry.mBodySize;
entry.mImageSize = -1;
entry.mBodySize = 0;
mHeaderIDMap.erase(entry.mID);
- mTexturesSizeMap.erase(entry.mID);
-
- mTexturesSizeTotal -= entry.mBodySize;
+ mTexturesSizeMap.erase(entry.mID);
mFreeList.insert(idx);
}