From c1cd237f55d5276c1b0bafdb225122c36331dba1 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Fri, 19 Jun 2020 12:25:50 +0000 Subject: [PATCH] In Host_Main, loop until host.state == host_shutdown instead of infinitely. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12695 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 5 ++++- host_cmd.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/host.c b/host.c index 1bcd62b5..8c825f48 100644 --- a/host.c +++ b/host.c @@ -668,7 +668,8 @@ void Host_Main(void) host.realtime = 0; host.dirtytime = Sys_DirtyTime(); - for (;;) + + while(host.state != host_shutdown) { if (setjmp(host.abortframe)) { @@ -1066,6 +1067,8 @@ void Host_Main(void) host.framecount++; } + + Sys_Quit(0); } //============================================================================ diff --git a/host_cmd.c b/host_cmd.c index ef7f664d..07750479 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -58,7 +58,7 @@ void Host_Quit_f(cmd_state_t *cmd) if(host.state == host_shutdown) Con_Printf("shutting down already!\n"); else - Sys_Quit (0); + host.state = host_shutdown; } /* -- 2.39.2