comparison src/video/SDL_video.c @ 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 d87db9cf6a31
children d3f330fc2009
comparison
equal deleted inserted replaced
3691:9fed2aa469ed 3692:ad85eb21a559
1641 texture->g = 255; 1641 texture->g = 255;
1642 texture->b = 255; 1642 texture->b = 255;
1643 texture->a = 255; 1643 texture->a = 255;
1644 texture->renderer = renderer; 1644 texture->renderer = renderer;
1645 texture->next = renderer->textures; 1645 texture->next = renderer->textures;
1646 if (renderer->textures) {
1647 renderer->textures->prev = texture;
1648 }
1646 renderer->textures = texture; 1649 renderer->textures = texture;
1647 1650
1648 if (renderer->CreateTexture(renderer, texture) < 0) { 1651 if (renderer->CreateTexture(renderer, texture) < 0) {
1649 SDL_DestroyTexture(texture); 1652 SDL_DestroyTexture(texture);
1650 return 0; 1653 return 0;
2694 SDL_SetError("Invalid texture"); 2697 SDL_SetError("Invalid texture");
2695 return; 2698 return;
2696 } 2699 }
2697 2700
2698 renderer = texture->renderer; 2701 renderer = texture->renderer;
2702 if (texture->next) {
2703 texture->next->prev = texture->prev;
2704 }
2699 if (texture->prev) { 2705 if (texture->prev) {
2700 texture->prev->next = texture->next; 2706 texture->prev->next = texture->next;
2701 } else { 2707 } else {
2702 renderer->textures = texture->next; 2708 renderer->textures = texture->next;
2703 } 2709 }