mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-04-18 18:40:34 +08:00
fix: game is blocked for launching
This commit is contained in:
parent
f84c4310f9
commit
1eeba344f7
@ -106,7 +106,6 @@ public final class Launcher extends Application {
|
||||
Schedulers.shutdown();
|
||||
Controllers.shutdown();
|
||||
Platform.exit();
|
||||
Lang.executeDelayed(OperatingSystem::forceGC, TimeUnit.SECONDS, 5, true);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -73,11 +73,15 @@ public final class Schedulers {
|
||||
public static synchronized void shutdown() {
|
||||
Logging.LOG.info("Shutting down executor services.");
|
||||
|
||||
// shutdownNow will interrupt all threads.
|
||||
// So when we want to close the app, no threads need to be waited for finish.
|
||||
// Sometimes it resolves the problem that the app does not exit.
|
||||
|
||||
if (CACHED_EXECUTOR != null)
|
||||
CACHED_EXECUTOR.shutdown();
|
||||
CACHED_EXECUTOR.shutdownNow();
|
||||
|
||||
if (IO_EXECUTOR != null)
|
||||
IO_EXECUTOR.shutdown();
|
||||
IO_EXECUTOR.shutdownNow();
|
||||
}
|
||||
|
||||
public static Future<?> schedule(Executor executor, Runnable command) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user