From 4bf220ce489a87084ceb508ce65994adbb63f36a Mon Sep 17 00:00:00 2001 From: TarikBR <64391349+TarikBR@users.noreply.github.com> Date: Sat, 22 Jun 2024 14:16:03 -0300 Subject: [PATCH] fix: dont remove task count listener until it reaches 0 If waitUltilDone() is called when you have 2 or more other tasks, the first one that is changed will still have tasks to wait for, but when it finishes it won't run because it was removed early. (translated) --- .../java/net/kdt/pojavlaunch/progresskeeper/ProgressKeeper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/progresskeeper/ProgressKeeper.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/progresskeeper/ProgressKeeper.java index e5a3b31dbd..41a5b5293d 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/progresskeeper/ProgressKeeper.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/progresskeeper/ProgressKeeper.java @@ -90,8 +90,8 @@ public static void waitUntilDone(final Runnable runnable) { public void onUpdateTaskCount(int taskCount) { if(taskCount == 0) { runnable.run(); + removeTaskCountListener(this); } - removeTaskCountListener(this); } }; addTaskCountListener(listener);