Fixed using the event queue lock before the mutex was created.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 19 Apr 2013 11:58:38 -0400
changeset 7077f8e3dcefed59
parent 7076 1666f7a7494e
child 7078 a2bddc1fb02f
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
     1.1 --- a/src/events/SDL_events.c	Tue Apr 16 01:38:08 2013 -0400
     1.2 +++ b/src/events/SDL_events.c	Fri Apr 19 11:58:38 2013 -0400
     1.3 @@ -123,12 +123,6 @@
     1.4         FIXME: Does this introduce any other bugs with events at startup?
     1.5       */
     1.6  
     1.7 -    /* No filter to start with, process most event types */
     1.8 -    SDL_EventOK = NULL;
     1.9 -    SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
    1.10 -    SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
    1.11 -    SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
    1.12 -
    1.13      /* Create the lock and set ourselves active */
    1.14  #if !SDL_THREADS_DISABLED
    1.15      if (!SDL_EventQ.lock) {
    1.16 @@ -138,6 +132,13 @@
    1.17          return (-1);
    1.18      }
    1.19  #endif /* !SDL_THREADS_DISABLED */
    1.20 +
    1.21 +    /* No filter to start with, process most event types */
    1.22 +    SDL_EventOK = NULL;
    1.23 +    SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
    1.24 +    SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
    1.25 +    SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
    1.26 +
    1.27      SDL_EventQ.active = 1;
    1.28  
    1.29      return (0);