From d296ce27efeb154d4e95c095d27a6a21efbbb8ed Mon Sep 17 00:00:00 2001 From: Bob Pendleton Date: Wed, 20 Feb 2008 23:27:33 +0000 Subject: [PATCH] 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. --- test/testgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testgl.c b/test/testgl.c index f14afe8b9..9ce9f4ed0 100644 --- a/test/testgl.c +++ b/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); } ++frames;