changeset 3692:ad85eb21a559

Fixed infinite loop at shutdown - update texture prev links
author Sam Lantinga <slouken@libsdl.org>
date Fri, 22 Jan 2010 15:55:20 +0000
parents 9fed2aa469ed
children d3f330fc2009
files src/video/SDL_video.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 {