From 65217086b64bdae2d520c8bcdda12444990eced6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 24 Jan 2010 19:47:17 +0000 Subject: [PATCH] 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 7f9bf1abe..aaa833557 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -163,6 +163,11 @@ SDL_VideoInit(const char *driver_name, Uint32 flags) 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 @@ SDL_VideoInit(const char *driver_name, Uint32 flags) 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;