Fixed SDL error when filtering events after shutdown.
authorSam Lantinga <slouken@libsdl.org>
Sat, 31 May 2014 11:33:25 -0700
changeset 8791 44dc9af6b7c2
parent 8790 851b3b4c06cb
child 8792 333216331863
Fixed SDL error when filtering events after shutdown. This can happen when restoring video modes during video system shutdown
src/events/SDL_events.c
--- a/src/events/SDL_events.c	Thu May 29 23:05:18 2014 +0200
+++ b/src/events/SDL_events.c	Sat May 31 11:33:25 2014 -0700
@@ -550,7 +550,7 @@
 void
 SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
 {
-    if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
+    if (SDL_EventQ.lock && SDL_LockMutex(SDL_EventQ.lock) == 0) {
         SDL_EventEntry *entry, *next;
         for (entry = SDL_EventQ.head; entry; entry = next) {
             next = entry->next;