From 6303941ac17cc8c0c113a6abc6bdaef92d9948e3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 8 Mar 2016 13:55:50 -0800 Subject: [PATCH] Fixed infinite timeout in SDL_WaitEventTimeout() - thanks ?????????? ???????? --- src/events/SDL_events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 75362d55b..0af027045 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -435,8 +435,6 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout) switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) { case -1: return 0; - case 1: - return 1; case 0: if (timeout == 0) { /* Polling and no events, just return */ @@ -448,6 +446,9 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout) } SDL_Delay(10); break; + default: + /* Has events */ + return 1; } } }