Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed infinite loop at shutdown - update texture prev links
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 22, 2010
1 parent 9062858 commit d6532c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -1643,6 +1643,9 @@ SDL_CreateTexture(Uint32 format, int access, int w, int h)
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) {
Expand Down Expand Up @@ -2696,6 +2699,9 @@ SDL_DestroyTexture(SDL_Texture * texture)
}

renderer = texture->renderer;
if (texture->next) {
texture->next->prev = texture->prev;
}
if (texture->prev) {
texture->prev->next = texture->next;
} else {
Expand Down

0 comments on commit d6532c9

Please sign in to comment.