Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed using the event queue lock before the mutex was created.
Browse files Browse the repository at this point in the history
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.  :)
  • Loading branch information
icculus committed Apr 19, 2013
1 parent baa7a25 commit adcece1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/events/SDL_events.c
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit adcece1

Please sign in to comment.