mirror of
https://github.com/yawut/SDL.git
synced 2026-08-26 10:44:39 -05:00
SDL_DestroyWindow is setting window->magic to NULL too early. -
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é
This commit is contained in:
@@ -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);
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user