fix: not shutting down executor service after game launched.
This commit is contained in:
@@ -507,12 +507,14 @@ public final class LauncherHelper {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case HIDE:
|
case HIDE:
|
||||||
|
launchingLatch.countDown();
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
// If application was stopped and execution services did not finish termination,
|
// If application was stopped and execution services did not finish termination,
|
||||||
// these codes will be executed.
|
// these codes will be executed.
|
||||||
if (Controllers.getStage() != null) {
|
if (Controllers.getStage() != null) {
|
||||||
Controllers.getStage().close();
|
Controllers.getStage().close();
|
||||||
launchingLatch.countDown();
|
Controllers.shutdown();
|
||||||
|
Schedulers.shutdown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -288,12 +288,14 @@ public class CancellableTaskExecutor extends TaskExecutor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
String oldName = Thread.currentThread().getName();
|
||||||
try {
|
try {
|
||||||
if (task.getName() != null)
|
if (task.getName() != null)
|
||||||
Thread.currentThread().setName(task.getName());
|
Thread.currentThread().setName(task.getName());
|
||||||
if (!executeTask(parentTask, task))
|
if (!executeTask(parentTask, task))
|
||||||
success.set(false);
|
success.set(false);
|
||||||
} finally {
|
} finally {
|
||||||
|
Thread.currentThread().setName(oldName);
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ public final class Schedulers {
|
|||||||
Logging.LOG.info("Shutting down executor services.");
|
Logging.LOG.info("Shutting down executor services.");
|
||||||
|
|
||||||
if (CACHED_EXECUTOR != null)
|
if (CACHED_EXECUTOR != null)
|
||||||
CACHED_EXECUTOR.shutdownNow();
|
CACHED_EXECUTOR.shutdown();
|
||||||
|
|
||||||
if (IO_EXECUTOR != null)
|
if (IO_EXECUTOR != null)
|
||||||
IO_EXECUTOR.shutdownNow();
|
IO_EXECUTOR.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Future<?> schedule(Executor executor, Runnable command) {
|
public static Future<?> schedule(Executor executor, Runnable command) {
|
||||||
|
|||||||
Reference in New Issue
Block a user