From 5f8679e5d2fb37a25dfd9b5ed580b0041990d7be Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 21 Jun 2025 12:32:24 +1000 Subject: [PATCH] Fix memory leak on reload while importing --- .../me/cortex/voxy/commonImpl/importers/WorldImporter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java index 2cb1c694..bda5ff0a 100644 --- a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java @@ -149,6 +149,10 @@ public class WorldImporter implements IDataImporter { this.world.releaseRef(); this.threadPool.shutdown(); } + //Free all the remaining entries by running the lambda + while (!this.jobQueue.isEmpty()) { + this.jobQueue.poll().run(); + } } private interface IImporterMethod {