diff --git a/glxgears.c b/glxgears.c index 76b55f8..3c6af3b 100644 --- a/glxgears.c +++ b/glxgears.c @@ -179,6 +179,7 @@ static void cleanup(void) { glDeleteLists(gear2, 1); glDeleteLists(gear3, 1); glutDestroyWindow(win); + exit(EXIT_SUCCESS); } static void draw(void) { @@ -224,10 +225,7 @@ static void draw(void) { fflush(stdout); T0 = t; Frames = 0; - if ((t >= 999.0 * autoexit) && (autoexit)) { - cleanup(); - exit(EXIT_SUCCESS); - } + if ((t >= 999.0 * autoexit) && (autoexit)) cleanup(); } } @@ -272,8 +270,6 @@ static void key(unsigned char k, int, int) { break; case 27: /* Escape */ cleanup(); - exit(EXIT_SUCCESS); - break; default: return; }