Oops, will crash if we remove the end?

This commit is contained in:
Unknown W. Brackets 2013-02-25 00:59:23 -08:00
parent d73fcebc3f
commit 347eb253dc

View File

@ -80,7 +80,7 @@ void TextureCache::Clear(bool delete_them) {
// Removes old textures.
void TextureCache::Decimate() {
glBindTexture(GL_TEXTURE_2D, 0);
for (TexCache::iterator iter = cache.begin(), end = cache.end(); iter != end; ) {
for (TexCache::iterator iter = cache.begin(); iter != cache.end(); ) {
if (iter->second.lastFrame + TEXTURE_KILL_AGE < gpuStats.numFrames) {
glDeleteTextures(1, &iter->second.texture);
cache.erase(iter++);