From adcece141e5a305dd8880d9bd6d40252e0fc9787 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 19 Apr 2013 11:58:38 -0400 Subject: [PATCH] Fixed using the event queue lock before the mutex was created. This has the benefit of ending the otherwise-bogus complaints that SDL_GetError() reports "Passed a NULL mutex" if you call it instead of checking if SDL_CreateWindow() actually succeeded. :) --- src/events/SDL_events.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index ade28a697..75aed9221 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -123,12 +123,6 @@ SDL_StartEventLoop(void) FIXME: Does this introduce any other bugs with events at startup? */ - /* No filter to start with, process most event types */ - SDL_EventOK = NULL; - SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); - SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); - SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); - /* Create the lock and set ourselves active */ #if !SDL_THREADS_DISABLED if (!SDL_EventQ.lock) { @@ -138,6 +132,13 @@ SDL_StartEventLoop(void) return (-1); } #endif /* !SDL_THREADS_DISABLED */ + + /* No filter to start with, process most event types */ + SDL_EventOK = NULL; + SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); + SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); + SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); + SDL_EventQ.active = 1; return (0);