diff src/video/SDL_video.c @ 3694:b0a707f589a6

Fixed bug #916 Shutting down the video shuts down the event loop, so don't do that after starting the event loop. :)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Jan 2010 19:47:17 +0000
parents d3f330fc2009
children f6a8be3fefa0
line wrap: on
line diff
--- a/src/video/SDL_video.c	Fri Jan 22 16:17:11 2010 +0000
+++ b/src/video/SDL_video.c	Sun Jan 24 19:47:17 2010 +0000
@@ -163,6 +163,11 @@
     int index;
     int i;
 
+    /* Check to make sure we don't overwrite '_this' */
+    if (_this != NULL) {
+        SDL_VideoQuit();
+    }
+
     /* Toggle the event thread flags, based on OS requirements */
 #if defined(MUST_THREAD_EVENTS)
     flags |= SDL_INIT_EVENTTHREAD;
@@ -177,10 +182,7 @@
     if (SDL_StartEventLoop(flags) < 0) {
         return -1;
     }
-    /* Check to make sure we don't overwrite '_this' */
-    if (_this != NULL) {
-        SDL_VideoQuit();
-    }
+
     /* Select the proper video driver */
     index = 0;
     video = NULL;