Fixed infinite timeout in SDL_WaitEventTimeout() - thanks Константин Гончарик
authorSam Lantinga
Tue, 08 Mar 2016 13:55:50 -0800
changeset 10106d240baef8248
parent 10105 c59a7e780093
child 10107 1d03c8d0caad
Fixed infinite timeout in SDL_WaitEventTimeout() - thanks Константин Гончарик
src/events/SDL_events.c
     1.1 --- a/src/events/SDL_events.c	Mon Mar 07 08:22:55 2016 -0500
     1.2 +++ b/src/events/SDL_events.c	Tue Mar 08 13:55:50 2016 -0800
     1.3 @@ -435,8 +435,6 @@
     1.4          switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
     1.5          case -1:
     1.6              return 0;
     1.7 -        case 1:
     1.8 -            return 1;
     1.9          case 0:
    1.10              if (timeout == 0) {
    1.11                  /* Polling and no events, just return */
    1.12 @@ -448,6 +446,9 @@
    1.13              }
    1.14              SDL_Delay(10);
    1.15              break;
    1.16 +        default:
    1.17 +            /* Has events */
    1.18 +            return 1;
    1.19          }
    1.20      }
    1.21  }