Fixed SDL error when filtering events after shutdown.

This can happen when restoring video modes during video system shutdown
This commit is contained in:
Sam Lantinga 2014-05-31 11:33:25 -07:00
parent f29ac39934
commit 52222db255
1 changed files with 1 additions and 1 deletions

View File

@ -550,7 +550,7 @@ SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
void void
SDL_FilterEvents(SDL_EventFilter filter, void *userdata) 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; SDL_EventEntry *entry, *next;
for (entry = SDL_EventQ.head; entry; entry = next) { for (entry = SDL_EventQ.head; entry; entry = next) {
next = entry->next; next = entry->next;