mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 22:48:30 +00:00
Fixed double-free when using window surfaces
This commit is contained in:
@@ -4429,6 +4429,8 @@ void SDL_DestroyWindow(SDL_Window *window)
|
|||||||
|
|
||||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_DESTROYED, 0, 0);
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_DESTROYED, 0, 0);
|
||||||
|
|
||||||
|
SDL_DestroyWindowSurface(window);
|
||||||
|
|
||||||
SDL_Renderer *renderer = SDL_GetRenderer(window);
|
SDL_Renderer *renderer = SDL_GetRenderer(window);
|
||||||
if (renderer) {
|
if (renderer) {
|
||||||
SDL_DestroyRendererWithoutFreeing(renderer);
|
SDL_DestroyRendererWithoutFreeing(renderer);
|
||||||
@@ -4469,8 +4471,6 @@ void SDL_DestroyWindow(SDL_Window *window)
|
|||||||
SDL_SetMouseFocus(NULL);
|
SDL_SetMouseFocus(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_DestroyWindowSurface(window);
|
|
||||||
|
|
||||||
// Make no context current if this is the current context window
|
// Make no context current if this is the current context window
|
||||||
if (window->flags & SDL_WINDOW_OPENGL) {
|
if (window->flags & SDL_WINDOW_OPENGL) {
|
||||||
if (_this->current_glwin == window) {
|
if (_this->current_glwin == window) {
|
||||||
|
Reference in New Issue
Block a user