From acfa06f0d2955e443ab71d3289c9d59a36374566 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sat, 25 Jun 2011 09:05:57 +0000 Subject: Add forced VM unloading to Com_Quit_f --- src/qcommon/common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qcommon/common.c b/src/qcommon/common.c index acf1b2f0..4a0e48ad 100644 --- a/src/qcommon/common.c +++ b/src/qcommon/common.c @@ -361,8 +361,14 @@ void Com_Quit_f( void ) { // don't try to shutdown if we are in a recursive error char *p = Cmd_Args( ); if ( !com_errorEntered ) { + // Some VMs might execute "quit" command directly, + // which would trigger an unload of active VM error. + // Sys_Quit will kill this process anyways, so + // a corrupt call stack makes no difference + VM_Forced_Unload_Start(); SV_Shutdown (p[0] ? p : "Server quit"); CL_Shutdown (p[0] ? p : "Client quit", qtrue); + VM_Forced_Unload_Done(); Com_Shutdown (); FS_Shutdown(qtrue); } -- cgit