cleanup now exits

This commit is contained in:
Lexxy Fox 2023-11-01 16:04:30 -05:00
parent 1786b8b3ae
commit a36ead2ceb

View File

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