Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

HandleEvent() returns done each time it is called. If done was set to…

… 0 the program should quit, but because done is not checked until *all* events are handled a

following event can reset done to 1 and prevent the program from terminating when told to. I fixed the while loop that handles events to check for the state of done
after handling each event. That could leave some events unhandled when the program exits, but it ensures that the program will exit.
  • Loading branch information
pendletonrc committed Feb 20, 2008
1 parent 6538c9d commit d296ce27efeb154d4e95c095d27a6a21efbbb8ed
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/testgl.c
@@ -666,7 +666,7 @@ RunGLTest(int argc, char *argv[],

/* Check if there's a pending event. */
while (SDL_PollEvent(&event)) {
while (!done && SDL_PollEvent(&event)) {
done = HandleEvent(&event);

0 comments on commit d296ce2

Please sign in to comment.