mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 00:59:44 +03:00
[FIX] Расширенная обработка ошибок NativeJVMHalt
This commit is contained in:
parent
ec5c076a16
commit
de47594083
3 changed files with 16 additions and 8 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue