Commit c41feca5de6e1b2eb849bb8a90328e381221b786

Philipp Wiesemann 2015-12-29T19:13:56

Fixed a crash if creating accelerated renderer after accessing window surface. Partially fixes Bugzilla #3196.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 68a5ab4..e5f4dc5 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -1488,6 +1488,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
     if (window->surface) {
         window->surface->flags &= ~SDL_DONTFREE;
         SDL_FreeSurface(window->surface);
+        window->surface = NULL;
     }
     if (_this->DestroyWindowFramebuffer) {
         _this->DestroyWindowFramebuffer(_this, window);