Fixed infinite loop at shutdown - update texture prev links
authorSam Lantinga <slouken@libsdl.org>
Fri, 22 Jan 2010 15:55:20 +0000
changeset 3692 ad85eb21a559
parent 3691 9fed2aa469ed
child 3693 d3f330fc2009
Fixed infinite loop at shutdown - update texture prev links
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Fri Jan 22 06:50:17 2010 +0000
+++ b/src/video/SDL_video.c	Fri Jan 22 15:55:20 2010 +0000
@@ -1643,6 +1643,9 @@
     texture->a = 255;
     texture->renderer = renderer;
     texture->next = renderer->textures;
+    if (renderer->textures) {
+        renderer->textures->prev = texture;
+    }
     renderer->textures = texture;
 
     if (renderer->CreateTexture(renderer, texture) < 0) {
@@ -2696,6 +2699,9 @@
     }
 
     renderer = texture->renderer;
+    if (texture->next) {
+        texture->next->prev = texture->prev;
+    }
     if (texture->prev) {
         texture->prev->next = texture->next;
     } else {