mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
video: NULL out pointer to freed window surface
This behavior matches SDL_RecreateWindow and makes it less likely that another piece of code (e.g. a DestroyWindowFramebuffer implementation) will attempt to use or free the stale surface pointer.
This commit is contained in:
parent
abcc6706fd
commit
8a5ee3faf9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user