Browse Source

Fixed bug 4426 - allows re-creation of software renderer

Switching between renderers "software -> opengl -> opengles2 -> software" fails.

"opengl -> opengles2" calls SDL_RecreateWindow() and frees "window->surface"
without marking it as "surface_invalid".
Sylvain Becker 6 years ago
parent
commit
1ed6021960
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/video/SDL_video.c

+ 1 - 0
src/video/SDL_video.c

@@ -1636,6 +1636,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
         window->surface->flags &= ~SDL_DONTFREE;
         window->surface->flags &= ~SDL_DONTFREE;
         SDL_FreeSurface(window->surface);
         SDL_FreeSurface(window->surface);
         window->surface = NULL;
         window->surface = NULL;
+        window->surface_valid = SDL_FALSE;
     }
     }
     if (_this->DestroyWindowFramebuffer) {
     if (_this->DestroyWindowFramebuffer) {
         _this->DestroyWindowFramebuffer(_this, window);
         _this->DestroyWindowFramebuffer(_this, window);