i_system: "fix" recursive i_quit

well this still aint working all to great, but atleast this allows me to quit the game if it gets stuck without having to always send a kill signal to it
This commit is contained in:
Alug 2025-12-07 23:49:40 -05:00 committed by NepDisk
parent baa30a1ba9
commit 8c8e475c36

View file

@ -1952,17 +1952,19 @@ INT32 I_StartupSystem(void)
return 0;
}
boolean is_quitting = false;
//
// I_Quit
//
void I_Quit(void)
{
static SDL_bool quiting = SDL_FALSE;
/* prevent recursive I_Quit() */
if (quiting) goto death;
if (is_quitting)
abort();
is_quitting = true;
SDLforceUngrabMouse();
quiting = SDL_FALSE;
M_SaveConfig(NULL); //save game config, cvars..
D_SaveBan(); // save the ban list
@ -1997,7 +1999,7 @@ void I_Quit(void)
}
if (myargmalloc)
free(myargv); // Deallocate allocated memory
death:
W_Shutdown();
exit(0);
}