Implemented clean shutdown

no crash on exit (stops debugger going nuts too)
This commit is contained in:
Simon 2020-07-07 23:22:47 +01:00
parent ab47451b12
commit 79f9d36d70
4 changed files with 13 additions and 5 deletions

View file

@ -1754,6 +1754,7 @@ void jni_shutdown()
int JNI_OnLoad(JavaVM* vm, void* reserved)
{
JNIEnv *env;
jVM = vm;
if((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK)
{
ALOGE("Failed JNI_OnLoad");

View file

@ -263,7 +263,7 @@ void Sys_DoStartProcess( char *cmdline );
void Sys_Exit( int ex ) {
LOGI("Sys_Exit");
exit(1);
//exit(1);
Sys_ConsoleInputShutdown();
@ -281,12 +281,12 @@ void Sys_Exit( int ex ) {
// We can't do this
// as long as GL DLL's keep installing with atexit...
//exit(ex);
_exit( ex );
//_exit( ex );
#else
// Give me a backtrace on error exits.
assert( ex == 0 );
exit( ex );
//assert( ex == 0 );
//exit( ex );
#endif
}
@ -1378,4 +1378,6 @@ int VR_main( int argc, char* argv[] ) {
#endif
Com_Frame();
}
CL_ShutdownUI();
}

View file

@ -2645,7 +2645,7 @@ void CL_Shutdown( void ) {
S_Shutdown();
CL_ShutdownRef();
CL_ShutdownUI();
//CL_ShutdownUI();
Cmd_RemoveCommand( "cmd" );
Cmd_RemoveCommand( "configstrings" );

View file

@ -2894,6 +2894,11 @@ static void FS_Startup( const char *gameName ) {
Com_Printf( "----- FS_Startup -----\n" );
for ( int i = 0; i < MAX_FILE_HANDLES; i++ ) {
fsh[i].fileSize = 0;
}
fs_debug = Cvar_Get( "fs_debug", "0", 0 );
fs_copyfiles = Cvar_Get( "fs_copyfiles", "0", CVAR_INIT );
fs_cdpath = Cvar_Get( "fs_cdpath", Sys_DefaultCDPath(), CVAR_INIT );