diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index b6d083a53..d8778aa4d 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2796,6 +2796,8 @@ SDL_DestroyWindow(SDL_Window * window) if (window->surface) { window->surface->flags &= ~SDL_DONTFREE; SDL_FreeSurface(window->surface); + window->surface = NULL; + window->surface_valid = SDL_FALSE; } if (_this->DestroyWindowFramebuffer) { _this->DestroyWindowFramebuffer(_this, window);