From a259527a20b6e4fac6baa0a258cc21a264dad8e5 Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 13 Dec 2019 09:37:42 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A5=D0=B0=D0=BA=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20Forge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pro/gravit/launcher/client/ClientLauncher.java | 9 +++++++-- .../launcher/request/websockets/ClientJSONPoint.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) 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 57a23d37..046ebf9c 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -299,7 +299,12 @@ private static void launch(ClientProfile profile, Params params) throws Throwabl Launcher.LAUNCHED.set(true); JVMHelper.fullGC(); // Invoke main method - mainMethod.invokeWithArguments((Object) args.toArray(new String[0])); + try { + mainMethod.invokeWithArguments((Object) args.toArray(new String[0])); + } finally { + Request.service.close(); + } + } private static Process process = null; @@ -501,7 +506,7 @@ public static void main(String... args) throws Throwable { ClientService.classLoader = classLoader; classLoader.addURL(IOHelper.getCodeSource(ClientLauncher.class).toUri().toURL()); //classForName(classLoader, "com.google.common.collect.ForwardingMultimap"); - ClientService.baseURLs = classpath; + ClientService.baseURLs = classLoader.getURLs(); LogHelper.debug("Starting JVM and client WatchService"); FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher(); FileNameMatcher clientMatcher = profile.getClientUpdateMatcher(); diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java index 488cf589..3249510b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientJSONPoint.java @@ -108,7 +108,7 @@ public void close() throws InterruptedException { ch.closeFuture().sync(); } - //group.shutdownGracefully(); + group.shutdownGracefully(); } public void eval(final String text) {