summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-01-08 23:46:30 -0500
committerLioncash <mathew1800@gmail.com>2013-01-08 23:46:30 -0500
commitd9ea718559a1b820278f7517be7b95a0d2263bd2 (patch)
tree64d4d6966f0ec9c8f754e990e9a0a8c4e194a718 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp
parent4f4aa4860df98f401384f6e598cb649b13882e79 (diff)
Fix an issue where an iterator would become invalidated in TextureCache::ClearRenderTargets()
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index e3152455df..cfbd4eb6c8 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -204,12 +204,16 @@ void TextureCache::ClearRenderTargets()
iter = textures.begin(),
tcend = textures.end();
- for (; iter!=tcend; ++iter)
+ while (iter != tcend)
+ {
if (iter->second->type == TCET_EC_VRAM)
{
delete iter->second;
- textures.erase(iter);
+ textures.erase(iter++);
}
+ else
+ ++iter;
+ }
}
bool TextureCache::CheckForCustomTextureLODs(u64 tex_hash, int texformat, unsigned int levels)