Fixed infinite loop at shutdown - update texture prev links
authorSam Lantinga <slouken@libsdl.org>
Fri, 22 Jan 2010 15:55:20 +0000
changeset 3692ad85eb21a559
parent 3691 9fed2aa469ed
child 3693 d3f330fc2009
Fixed infinite loop at shutdown - update texture prev links
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Fri Jan 22 06:50:17 2010 +0000
     1.2 +++ b/src/video/SDL_video.c	Fri Jan 22 15:55:20 2010 +0000
     1.3 @@ -1643,6 +1643,9 @@
     1.4      texture->a = 255;
     1.5      texture->renderer = renderer;
     1.6      texture->next = renderer->textures;
     1.7 +    if (renderer->textures) {
     1.8 +        renderer->textures->prev = texture;
     1.9 +    }
    1.10      renderer->textures = texture;
    1.11  
    1.12      if (renderer->CreateTexture(renderer, texture) < 0) {
    1.13 @@ -2696,6 +2699,9 @@
    1.14      }
    1.15  
    1.16      renderer = texture->renderer;
    1.17 +    if (texture->next) {
    1.18 +        texture->next->prev = texture->prev;
    1.19 +    }
    1.20      if (texture->prev) {
    1.21          texture->prev->next = texture->next;
    1.22      } else {