diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lltexturecache.cpp | 20 | ||||
-rw-r--r-- | linden/indra/newview/lltexturecache.h | 1 |
2 files changed, 14 insertions, 7 deletions
diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index ae0a63f..56f3719 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp | |||
@@ -1225,9 +1225,7 @@ void LLTextureCache::readHeaderCache() | |||
1225 | { | 1225 | { |
1226 | for (std::set<LLUUID>::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) | 1226 | for (std::set<LLUUID>::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) |
1227 | { | 1227 | { |
1228 | mHeaderMutex.unlock(); | 1228 | removeFromCacheLocked(*iter); |
1229 | removeFromCache(*iter); | ||
1230 | mHeaderMutex.lock(); | ||
1231 | } | 1229 | } |
1232 | // If we removed any entries, we need to rebuild the entries list, | 1230 | // If we removed any entries, we need to rebuild the entries list, |
1233 | // write the header, and call this again | 1231 | // write the header, and call this again |
@@ -1246,7 +1244,7 @@ void LLTextureCache::readHeaderCache() | |||
1246 | writeEntriesAndClose(new_entries); | 1244 | writeEntriesAndClose(new_entries); |
1247 | mHeaderMutex.unlock(); // unlock the mutex before calling again | 1245 | mHeaderMutex.unlock(); // unlock the mutex before calling again |
1248 | readHeaderCache(); // repeat with new entries file | 1246 | readHeaderCache(); // repeat with new entries file |
1249 | mHeaderMutex.lock(); | 1247 | return; |
1250 | } | 1248 | } |
1251 | else | 1249 | else |
1252 | { | 1250 | { |
@@ -1611,7 +1609,6 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) | |||
1611 | { | 1609 | { |
1612 | if (!mReadOnly) | 1610 | if (!mReadOnly) |
1613 | { | 1611 | { |
1614 | LLMutexLock lock(&mHeaderMutex); | ||
1615 | Entry entry; | 1612 | Entry entry; |
1616 | S32 idx = openAndReadEntry(id, entry, false); | 1613 | S32 idx = openAndReadEntry(id, entry, false); |
1617 | if (idx >= 0) | 1614 | if (idx >= 0) |
@@ -1628,17 +1625,26 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) | |||
1628 | return false; | 1625 | return false; |
1629 | } | 1626 | } |
1630 | 1627 | ||
1631 | void LLTextureCache::removeFromCache(const LLUUID& id) | 1628 | void LLTextureCache::removeFromCacheLocked(const LLUUID& id) |
1632 | { | 1629 | { |
1633 | //llwarns << "Removing texture from cache: " << id << llendl; | 1630 | //llwarns << "Removing texture from cache: " << id << llendl; |
1634 | if (!mReadOnly) | 1631 | if (!mReadOnly) |
1635 | { | 1632 | { |
1636 | removeHeaderCacheEntry(id); | 1633 | removeHeaderCacheEntry(id); |
1637 | LLMutexLock lock(&mHeaderMutex); | ||
1638 | LLAPRFile::remove(getTextureFileName(id)); | 1634 | LLAPRFile::remove(getTextureFileName(id)); |
1639 | } | 1635 | } |
1640 | } | 1636 | } |
1641 | 1637 | ||
1638 | void LLTextureCache::removeFromCache(const LLUUID& id) | ||
1639 | { | ||
1640 | //llwarns << "Removing texture from cache: " << id << llendl; | ||
1641 | if (!mReadOnly) | ||
1642 | { | ||
1643 | LLMutexLock lock(&mHeaderMutex); | ||
1644 | LLTextureCache::removeFromCacheLocked(id); | ||
1645 | } | ||
1646 | } | ||
1647 | |||
1642 | ////////////////////////////////////////////////////////////////////////////// | 1648 | ////////////////////////////////////////////////////////////////////////////// |
1643 | 1649 | ||
1644 | LLTextureCache::ReadResponder::ReadResponder() | 1650 | LLTextureCache::ReadResponder::ReadResponder() |
diff --git a/linden/indra/newview/lltexturecache.h b/linden/indra/newview/lltexturecache.h index 45804c2..c859b9a 100644 --- a/linden/indra/newview/lltexturecache.h +++ b/linden/indra/newview/lltexturecache.h | |||
@@ -158,6 +158,7 @@ private: | |||
158 | S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); | 158 | S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); |
159 | S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); | 159 | S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); |
160 | bool removeHeaderCacheEntry(const LLUUID& id); | 160 | bool removeHeaderCacheEntry(const LLUUID& id); |
161 | void removeFromCacheLocked(const LLUUID& id); | ||
161 | 162 | ||
162 | private: | 163 | private: |
163 | // Internal | 164 | // Internal |