diff options
author | Sam Lantinga <slouken@libsdl.org> | 2010-01-22 15:55:20 +0000 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2010-01-22 15:55:20 +0000 |
commit | b4f5a3c8b7d278a11ee31519c70031901e2a37fc (patch) | |
tree | d2e980654dcda4bb5dfdcbb5b401c51d8e857e57 | |
parent | 8de28c8753066f9ebc41c6574fe0e03396c97fc9 (diff) |
Fixed infinite loop at shutdown - update texture prev links
-rw-r--r-- | src/video/SDL_video.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 35b9c5845e..96af1e21f1 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -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) { @@ -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 { |