Fixed list loop caused when there are two entries in the list and the one being returned is already at the head.

This commit is contained in:
Sam Lantinga 2011-11-07 23:10:49 -05:00
parent c5b4e5f63e
commit 918d8540ea

View file

@ -470,7 +470,7 @@ GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex,
} }
if (entry) if (entry)
{ {
if (rdata->program_cache.count > 1) if (rdata->program_cache.head != entry)
{ {
if (entry->next) if (entry->next)
entry->next->prev = entry->prev; entry->next->prev = entry->prev;