소스 검색

video: Set window->surface NULL after freeing it.

Otherwise, when SDL_CreateWindowFramebuffer() is called again, it will return
the free'd surface instead of creating a new one.
Ryan C. Gordon 6 년 전
부모
커밋
60435712f2
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/video/SDL_video.c

+ 1 - 0
src/video/SDL_video.c

@@ -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) {