From 6619817e2442a82a58bbda913e91cab979bf64cc Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Wed, 20 Jul 2016 16:04:53 +0000 Subject: [PATCH] give java a chance to end it's miserable existence --- .../serverScript/src/shared/JavaLibrary.cpp | 39 +------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/engine/server/library/serverScript/src/shared/JavaLibrary.cpp b/engine/server/library/serverScript/src/shared/JavaLibrary.cpp index b94a0c52..588bbbff 100755 --- a/engine/server/library/serverScript/src/shared/JavaLibrary.cpp +++ b/engine/server/library/serverScript/src/shared/JavaLibrary.cpp @@ -1046,10 +1046,6 @@ void JavaLibrary::initializeJavaThread() return; } -#if defined(_DEBUG) //&& defined(linux) -#define REMOTE_DEBUG_ON -#endif - // set up the args to initialize the jvm std::string classPath = "-Djava.class.path="; classPath += ConfigServerGame::getScriptPath(); @@ -1129,30 +1125,6 @@ void JavaLibrary::initializeJavaThread() options.push_back(tempOption); } -// never used it but this is actually a cool feature, if the crusty turd still works -#ifdef REMOTE_DEBUG_ON - char *jdwpBuffer = nullptr; - if (ConfigServerGame::getUseRemoteDebugJava()) - { - tempOption.optionString = "-Xdebug"; - options.push_back(tempOption); - - // we need to copy the -Xrunjdwp parameter into a char buffer due to a bug - // in the Java VM - const char * jdwpString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n"; - jdwpBuffer = new char[strlen(jdwpString) + 32]; - strcpy(jdwpBuffer, jdwpString); - - if (ConfigServerGame::getJavaDebugPort()[0] == '\0') - { - strcat(jdwpBuffer, ",address="); - strcat(jdwpBuffer, ConfigServerGame::getJavaDebugPort()); - } - tempOption.optionString = jdwpBuffer; - options.push_back(tempOption); - } -#endif // REMOTE_DEBUG_ON - tempOption.optionString = const_cast(classPath.c_str()); options.push_back(tempOption); @@ -1183,14 +1155,6 @@ void JavaLibrary::initializeJavaThread() JNIEnv * env = nullptr; jint result = (*JNI_CreateJavaVMProc)(&ms_jvm, reinterpret_cast(&env), &vm_args); -#ifdef REMOTE_DEBUG_ON - if (jdwpBuffer != nullptr) - { - delete[] jdwpBuffer; - jdwpBuffer = nullptr; - } -#endif - if (result != 0) { FATAL (true, ("Failed to CreateJavaVMProc: %d", result)); @@ -1213,7 +1177,8 @@ void JavaLibrary::initializeJavaThread() ms_shutdownJava->wait(); // clean up - IGNORE_RETURN(ms_jvm->DestroyJavaVM()); // yeah, screw it, l + ms_jvm->DestroyJavaVM(); + Os::sleep(1000); // give java a chance to end it's miserable existence ms_jvm = nullptr; if (ConfigServerGame::getTrapScriptCrashes())