Skip to content

Commit

Permalink
Quick fix for an invalid iterator
Browse files Browse the repository at this point in the history
textures_by_hash_iter was pointing to elements of textures_by_hash, but pointing to textures_by_address.end() instead of textures_by_hash.end() when it's not pointing to an element.
  • Loading branch information
mimimi085181 committed Jun 24, 2015
1 parent 8493feb commit 64b414f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Core/VideoCommon/TextureCacheBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,18 +981,18 @@ TextureCache::TCacheEntryBase* TextureCache::AllocateTexture(const TCacheEntryCo
INCSTAT(stats.numTexturesCreated);
}

entry->textures_by_hash_iter = textures_by_address.end();
entry->textures_by_hash_iter = textures_by_hash.end();
return entry;
}

TextureCache::TexCache::iterator TextureCache::FreeTexture(TexCache::iterator iter)
{
TCacheEntryBase* entry = iter->second;

if (entry->textures_by_hash_iter != textures_by_address.end())
if (entry->textures_by_hash_iter != textures_by_hash.end())
{
textures_by_hash.erase(entry->textures_by_hash_iter);
entry->textures_by_hash_iter = textures_by_address.end();
entry->textures_by_hash_iter = textures_by_hash.end();
}

entry->frameCount = FRAMECOUNT_INVALID;
Expand Down

0 comments on commit 64b414f

Please sign in to comment.