Fixed list loop caused when there are two entries in the list and the one being returned is already at the head.
authorSam Lantinga <slouken@libsdl.org>
Mon, 07 Nov 2011 23:10:49 -0500
changeset 60614746757951ac
parent 6060 59d398ac031e
child 6062 2e4a1b92dc6f
Fixed list loop caused when there are two entries in the list and the one being returned is already at the head.
src/render/opengles2/SDL_render_gles2.c
     1.1 --- a/src/render/opengles2/SDL_render_gles2.c	Mon Nov 07 23:07:00 2011 -0500
     1.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Mon Nov 07 23:10:49 2011 -0500
     1.3 @@ -470,7 +470,7 @@
     1.4      }
     1.5      if (entry)
     1.6      {
     1.7 -        if (rdata->program_cache.count > 1)
     1.8 +        if (rdata->program_cache.head != entry)
     1.9          {
    1.10              if (entry->next)
    1.11                  entry->next->prev = entry->prev;