Fixed crash if the rendering system couldn't create an OpenGL window.
authorSam Lantinga <slouken@libsdl.org>
Sat, 07 Jan 2012 21:01:33 -0800
changeset 6182 eb6796f3e598
parent 6181 e29f01fa2750
child 6183 6d9a266e04bb
Fixed crash if the rendering system couldn't create an OpenGL window.
src/render/opengl/SDL_render_gl.c
--- a/src/render/opengl/SDL_render_gl.c	Sat Jan 07 23:33:15 2012 -0500
+++ b/src/render/opengl/SDL_render_gl.c	Sat Jan 07 21:01:33 2012 -0800
@@ -239,6 +239,8 @@
     window_flags = SDL_GetWindowFlags(window);
     if (!(window_flags & SDL_WINDOW_OPENGL)) {
         if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
+            /* Uh oh, better try to put it back... */
+            SDL_RecreateWindow(window, window_flags);
             return NULL;
         }
     }