Fixed bug #916
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Jan 2010 19:47:17 +0000
changeset 3694b0a707f589a6
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
     1.1 --- a/src/video/SDL_video.c	Fri Jan 22 16:17:11 2010 +0000
     1.2 +++ b/src/video/SDL_video.c	Sun Jan 24 19:47:17 2010 +0000
     1.3 @@ -163,6 +163,11 @@
     1.4      int index;
     1.5      int i;
     1.6  
     1.7 +    /* Check to make sure we don't overwrite '_this' */
     1.8 +    if (_this != NULL) {
     1.9 +        SDL_VideoQuit();
    1.10 +    }
    1.11 +
    1.12      /* Toggle the event thread flags, based on OS requirements */
    1.13  #if defined(MUST_THREAD_EVENTS)
    1.14      flags |= SDL_INIT_EVENTTHREAD;
    1.15 @@ -177,10 +182,7 @@
    1.16      if (SDL_StartEventLoop(flags) < 0) {
    1.17          return -1;
    1.18      }
    1.19 -    /* Check to make sure we don't overwrite '_this' */
    1.20 -    if (_this != NULL) {
    1.21 -        SDL_VideoQuit();
    1.22 -    }
    1.23 +
    1.24      /* Select the proper video driver */
    1.25      index = 0;
    1.26      video = NULL;