From 12096496d46c0f814a12b761896fcb775580d256 Mon Sep 17 00:00:00 2001 From: Cody Date: Sun, 14 Jan 2024 14:05:16 -0700 Subject: [PATCH] Clear resource classes, class bytes, and files after deleting directory from resource list to clear memory. --- .../bytecodeviewer/gui/contextmenu/resourcelist/Delete.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Delete.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Delete.java index c79e0ed76..e4586a7a6 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Delete.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Delete.java @@ -5,6 +5,7 @@ import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; +import the.bytecode.club.bytecodeviewer.gui.resourcelist.ResourceTreeNode; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; /*************************************************************************** @@ -40,6 +41,10 @@ public Delete() public void actionPerformed(ActionEvent e) { BytecodeViewer.viewer.resourcePane.removeNode(tree, selPath); + BytecodeViewer.resourceContainers.get(selPath.getLastPathComponent().toString()).resourceClassBytes.clear(); + BytecodeViewer.resourceContainers.get(selPath.getLastPathComponent().toString()).resourceFiles.clear(); + BytecodeViewer.resourceContainers.get(selPath.getLastPathComponent().toString()).resourceClasses.clear(); + System.gc(); } }))); }