Fixed bug #916
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Jan 2010 19:47:17 +0000
changeset 3694 b0a707f589a6
parent 3693 d3f330fc2009
child 3695 f6a8be3fefa0
Fixed bug #916 Shutting down the video shuts down the event loop, so don't do that after starting the event loop. :)
src/video/SDL_video.c
--- 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;