mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-08 00:59:44 +00:00
Fix an issue where an iterator would become invalidated in TextureCache::ClearRenderTargets()
This commit is contained in:
parent
4f4aa4860d
commit
d9ea718559
1 changed files with 6 additions and 2 deletions
|
@ -204,11 +204,15 @@ void TextureCache::ClearRenderTargets()
|
||||||
iter = textures.begin(),
|
iter = textures.begin(),
|
||||||
tcend = textures.end();
|
tcend = textures.end();
|
||||||
|
|
||||||
for (; iter!=tcend; ++iter)
|
while (iter != tcend)
|
||||||
|
{
|
||||||
if (iter->second->type == TCET_EC_VRAM)
|
if (iter->second->type == TCET_EC_VRAM)
|
||||||
{
|
{
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
textures.erase(iter);
|
textures.erase(iter++);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue