mirror of
https://github.com/yawut/SDL.git
synced 2026-07-31 23:43:47 -05:00
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. :)
This commit is contained in:
parent
7cdcd5bebb
commit
8cc072db1b
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user