Skip to content

Commit

Permalink
Fixed infinite timeout in SDL_WaitEventTimeout() - thanks ?????????? …
Browse files Browse the repository at this point in the history
…????????
  • Loading branch information
slouken committed Mar 8, 2016
1 parent 2a754ca commit 6303941
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/events/SDL_events.c
Expand Up @@ -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 */
Expand All @@ -448,6 +446,9 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
}
SDL_Delay(10);
break;
default:
/* Has events */
return 1;
}
}
}
Expand Down

0 comments on commit 6303941

Please sign in to comment.