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

Commit

Permalink
SDL_DestroyWindow is setting window->magic to NULL too early. -
Browse files Browse the repository at this point in the history
window->magic is also checked in SDL_DestroyRenderer. All cleanup code
like freeing the renderer and textures is not executed.
The patch moves window_magic = NULL behind the SDL_DestroyRenderer call.

Kind regards,

Andr?
  • Loading branch information
slouken committed Sep 27, 2010
1 parent dc9b6f1 commit 8ab485e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/SDL_video.c
Expand Up @@ -1447,7 +1447,6 @@ SDL_DestroyWindow(SDL_Window * window)
SDL_VideoDisplay *display;

CHECK_WINDOW_MAGIC(window, );
window->magic = NULL;

if (window->title) {
SDL_free(window->title);
Expand All @@ -1466,6 +1465,9 @@ SDL_DestroyWindow(SDL_Window * window)
SDL_GL_UnloadLibrary();
}

/* Now invalidate magic */
window->magic = NULL;

/* Unlink the window from the list */
display = window->display;
if (window->next) {
Expand Down

0 comments on commit 8ab485e

Please sign in to comment.