Skip to content

Commit

Permalink
video: Set window->surface NULL after freeing it.
Browse files Browse the repository at this point in the history
Otherwise, when SDL_CreateWindowFramebuffer() is called again, it will return
the free'd surface instead of creating a new one.
  • Loading branch information
icculus committed Jun 3, 2020
1 parent eea0b0e commit 6043571
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/video/SDL_video.c
Expand Up @@ -2374,6 +2374,7 @@ SDL_GetWindowSurface(SDL_Window * window)
if (window->surface) {
window->surface->flags &= ~SDL_DONTFREE;
SDL_FreeSurface(window->surface);
window->surface = NULL;
}
window->surface = SDL_CreateWindowFramebuffer(window);
if (window->surface) {
Expand Down

0 comments on commit 6043571

Please sign in to comment.