Commit 52222db2550d4fd3f4c0748d73ab8cf39c043761

Sam Lantinga 2014-05-31T11:33:25

Fixed SDL error when filtering events after shutdown. This can happen when restoring video modes during video system shutdown

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c
index 7a98c30..28be2ed 100644
--- a/src/events/SDL_events.c
+++ b/src/events/SDL_events.c
@@ -550,7 +550,7 @@ SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
 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;