Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix an issue where an iterator would become invalidated in TextureCac…
…he::ClearRenderTargets()
  • Loading branch information
lioncash committed Jan 9, 2013
1 parent 4f4aa48 commit d9ea718
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/Core/VideoCommon/Src/TextureCacheBase.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit d9ea718

Please sign in to comment.