Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
HandleEvent() returns done each time it is called. If done was set to…
Browse files Browse the repository at this point in the history
… 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 d296ce2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/testgl.c
Expand Up @@ -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);
}
++frames;
Expand Down

0 comments on commit d296ce2

Please sign in to comment.