Skip to content

Commit ee72442

Browse files
committed
Fixed double-free when using window surfaces
1 parent 434ca30 commit ee72442

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/video/SDL_video.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4429,6 +4429,8 @@ void SDL_DestroyWindow(SDL_Window *window)
44294429

44304430
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_DESTROYED, 0, 0);
44314431

4432+
SDL_DestroyWindowSurface(window);
4433+
44324434
SDL_Renderer *renderer = SDL_GetRenderer(window);
44334435
if (renderer) {
44344436
SDL_DestroyRendererWithoutFreeing(renderer);
@@ -4469,8 +4471,6 @@ void SDL_DestroyWindow(SDL_Window *window)
44694471
SDL_SetMouseFocus(NULL);
44704472
}
44714473

4472-
SDL_DestroyWindowSurface(window);
4473-
44744474
// Make no context current if this is the current context window
44754475
if (window->flags & SDL_WINDOW_OPENGL) {
44764476
if (_this->current_glwin == window) {

0 commit comments

Comments
 (0)