src/events/SDL_events.c
changeset 10488 3e61babccbbe
parent 10106 d240baef8248
child 10573 422723a6efc3
     1.1 --- a/src/events/SDL_events.c	Fri Oct 07 17:49:33 2016 -0700
     1.2 +++ b/src/events/SDL_events.c	Fri Oct 07 17:58:02 2016 -0700
     1.3 @@ -332,7 +332,9 @@
     1.4                  }
     1.5              }
     1.6          }
     1.7 -        SDL_UnlockMutex(SDL_EventQ.lock);
     1.8 +        if (SDL_EventQ.lock) {
     1.9 +            SDL_UnlockMutex(SDL_EventQ.lock);
    1.10 +        }
    1.11      } else {
    1.12          return SDL_SetError("Couldn't lock event queue");
    1.13      }
    1.14 @@ -374,7 +376,7 @@
    1.15  #endif
    1.16  
    1.17      /* Lock the event queue */
    1.18 -    if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
    1.19 +    if (SDL_EventQ.lock && SDL_LockMutex(SDL_EventQ.lock) == 0) {
    1.20          SDL_EventEntry *entry, *next;
    1.21          Uint32 type;
    1.22          for (entry = SDL_EventQ.head; entry; entry = next) {