Fixed bug 4426 - allows re-creation of software renderer
authorSylvain Becker <sylvain.becker@gmail.com>
Sat, 15 Dec 2018 16:21:24 +0100
changeset 1247611f8bd1899c5
parent 12475 0ae268b6ddf0
child 12477 73f3ca85ac0e
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".
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Sat Dec 15 09:57:05 2018 -0500
     1.2 +++ b/src/video/SDL_video.c	Sat Dec 15 16:21:24 2018 +0100
     1.3 @@ -1636,6 +1636,7 @@
     1.4          window->surface->flags &= ~SDL_DONTFREE;
     1.5          SDL_FreeSurface(window->surface);
     1.6          window->surface = NULL;
     1.7 +        window->surface_valid = SDL_FALSE;
     1.8      }
     1.9      if (_this->DestroyWindowFramebuffer) {
    1.10          _this->DestroyWindowFramebuffer(_this, window);