From 222e0d805b1a14f04f13eada8bfef901cfeeb086 Mon Sep 17 00:00:00 2001 From: Thibstars Date: Thu, 19 Oct 2023 19:40:33 +0200 Subject: [PATCH] Minor tweaks in an attempt to fix the LaunchFrame that remains open in some cases --- .../thibstars/btsd/desktop/launch/DesktopLauncher.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/thibstars/btsd/desktop/launch/DesktopLauncher.java b/src/main/java/com/github/thibstars/btsd/desktop/launch/DesktopLauncher.java index 3ed56cf..7f0d907 100644 --- a/src/main/java/com/github/thibstars/btsd/desktop/launch/DesktopLauncher.java +++ b/src/main/java/com/github/thibstars/btsd/desktop/launch/DesktopLauncher.java @@ -54,8 +54,8 @@ public void launch() throws InterruptedException { SwingUtilities.invokeLater(() -> { launchFrame.updateProgress(taskCount - tasksLeft.intValue()); launchFrame.updateProgressName(progressName); - if (tasksLeft == 0) { - launchFrame.setVisible(false); + if (tasksLeft <= 0) { + launchFrame.dispose(); } }); }; @@ -104,8 +104,8 @@ private static void shutDownLaunchProcess(ExecutorService executorService, Sched Runnable statusUpdater) throws InterruptedException { statusUpdater.run(); - executorService.shutdown(); executorService.awaitTermination(5, TimeUnit.SECONDS); + executorService.shutdown(); scheduledExecutorService.shutdown(); }