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 4305c920da
commit e30ec4d8ce

View File

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