diff options
| author | Lioncash <mathew1800@gmail.com> | 2013-01-08 23:46:30 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2013-01-08 23:46:30 -0500 |
| commit | d9ea718559a1b820278f7517be7b95a0d2263bd2 (patch) | |
| tree | 64d4d6966f0ec9c8f754e990e9a0a8c4e194a718 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp | |
| parent | 4f4aa4860df98f401384f6e598cb649b13882e79 (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.cpp | 8 |
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) |
