diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index 301cd7b1..b7ec12c8 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -61,7 +61,7 @@ public static void exitLauncher(int code) modulesManager.invokeEvent(new ClientExitPhase(code)); try { System.exit(code); - } catch (Exception e) //Forge Security Manager? + } catch (Throwable e) //Forge Security Manager? { NativeJVMHalt.haltA(code); } @@ -99,7 +99,7 @@ public static void main(String... args) throws Throwable { LogHelper.debug("Launcher started in %dms", endTime - startTime); //Request.service.close(); //FunctionalBridge.close(); - SystemService.exit(0); + LauncherEngine.exitLauncher(0); } public static void initGson(ClientModuleManager modulesManager) { diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index edd47cd2..42c85934 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -301,7 +301,7 @@ private static void launch(ClientProfile profile, Params params) throws Throwabl try { mainMethod.invokeWithArguments((Object) args.toArray(new String[0])); } finally { - SystemService.exit(0); + LauncherEngine.exitLauncher(0); } } diff --git a/Launcher/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java b/Launcher/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java index 257808d0..7b9293ec 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java +++ b/Launcher/src/main/java/pro/gravit/launcher/utils/NativeJVMHalt.java @@ -2,6 +2,7 @@ import pro.gravit.launcher.patches.FMLPatcher; import pro.gravit.utils.helper.JVMHelper; +import pro.gravit.utils.helper.LogHelper; import javax.swing.*; import java.awt.event.WindowEvent; @@ -22,23 +23,30 @@ private boolean aaabBooleanC_D() { } public static void haltA(int code) { + Throwable[] th = new Throwable[3]; NativeJVMHalt halt = new NativeJVMHalt(code); try { JVMHelper.RUNTIME.exit(code); - } catch (Throwable ignored) { + } catch (Throwable exitExc) { + th[0] = exitExc; try { new WindowShutdown(); - } catch (Throwable ignored1) { + } catch (Throwable windowExc) { + th[1] = windowExc; } } try { FMLPatcher.exit(code); - } catch (Throwable ignored) { + } catch (Throwable fmlExc) { + th[2] = fmlExc; + } + for(Throwable t : th) + { + if(t != null) LogHelper.error(t); } - - halt.aaabbb38C_D(); boolean a = halt.aaabBooleanC_D(); System.out.println(a); + halt.aaabbb38C_D(); }