From 3414d14a8e0272a6f88bdf9a3f597aa28a6393b8 Mon Sep 17 00:00:00 2001 From: McHorse Date: Thu, 1 Jul 2021 10:59:11 +0100 Subject: [PATCH] Fix memory leak with emitters that weren't deleted --- .../java/mchorse/blockbuster/client/KeyboardHandler.java | 1 + .../java/mchorse/blockbuster/client/RenderingHandler.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/mchorse/blockbuster/client/KeyboardHandler.java b/src/main/java/mchorse/blockbuster/client/KeyboardHandler.java index 647f2a77a..ad4e1ec1c 100644 --- a/src/main/java/mchorse/blockbuster/client/KeyboardHandler.java +++ b/src/main/java/mchorse/blockbuster/client/KeyboardHandler.java @@ -53,6 +53,7 @@ public void onUserLogOut(ClientDisconnectionFromServerEvent event) { ClientProxy.manager.reset(); ClientProxy.recordingOverlay.setVisible(false); + RenderingHandler.resetEmitters(); Minecraft.getMinecraft().addScheduledTask(StructureMorph::cleanUp); } diff --git a/src/main/java/mchorse/blockbuster/client/RenderingHandler.java b/src/main/java/mchorse/blockbuster/client/RenderingHandler.java index 985218ea4..7707718d3 100644 --- a/src/main/java/mchorse/blockbuster/client/RenderingHandler.java +++ b/src/main/java/mchorse/blockbuster/client/RenderingHandler.java @@ -211,6 +211,11 @@ public static void updateEmitters() } } + public static void resetEmitters() + { + emitters.clear(); + } + /** * Called by ASM */