diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 9f182af97..2948c96f7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -55,6 +55,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionNewObject; import com.jpexs.decompiler.flash.action.swf5.ActionSetMember; import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.dumpview.DumpInfo; import com.jpexs.decompiler.flash.dumpview.DumpInfoSwfNode; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle; @@ -322,16 +323,26 @@ public final class SWF implements SWFContainerItem, Timelined { tags.clear(); abcList.clear(); + swfList.swfs.clear(); as2Cache.clear(); as3Cache.clear(); timeline = null; + clearDumpInfo(dumpInfo); dumpInfo = null; jtt = null; binaryData = null; } + private void clearDumpInfo(DumpInfo di) { + for (DumpInfo childInfo : di.getChildInfos()) { + clearDumpInfo(childInfo); + } + + di.getChildInfos().clear(); + } + public Map getCharacters() { if (characters == null) { synchronized (this) { diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 4b9c321c5..66782b6bb 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -732,14 +732,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec }*/ swfs.clear(); oldItem = null; - previewPanel.clear(); - if (abcPanel != null) { - abcPanel.clearSwf(); - } - if (actionPanel != null) { - actionPanel.clearSource(); - } - previewPanel.clear(); + clear(); updateUi(); refreshTree(); } @@ -759,18 +752,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } swfs.remove(swfList); - if (abcPanel != null) { - for (SWF swf : swfList) { - if (abcPanel.getSwf() == swf) { - abcPanel.clearSwf(); - } - } - } - if (actionPanel != null) { - actionPanel.clearSource(); - } oldItem = null; - previewPanel.clear(); + clear(); updateUi(); refreshTree(); } @@ -1916,8 +1899,19 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec refreshTree(); } - public void refreshTree() { + private void clear() { + dumpViewPanel.clear(); previewPanel.clear(); + if (abcPanel != null) { + abcPanel.clearSwf(); + } + if (actionPanel != null) { + actionPanel.clearSource(); + } + } + + public void refreshTree() { + clear(); showCard(CARDEMPTYPANEL); TreeItem treeItem = tagTree.getCurrentTreeItem(); DumpInfo dumpInfo = (DumpInfo) dumpTree.getLastSelectedPathComponent(); diff --git a/src/com/jpexs/decompiler/flash/gui/dumpview/DumpViewPanel.java b/src/com/jpexs/decompiler/flash/gui/dumpview/DumpViewPanel.java index 7820f67a1..4612fc367 100644 --- a/src/com/jpexs/decompiler/flash/gui/dumpview/DumpViewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/dumpview/DumpViewPanel.java @@ -138,6 +138,10 @@ public class DumpViewPanel extends JPanel { add(new JScrollPane(dumpViewHexTable), BorderLayout.CENTER); } + public void clear() { + selectedDumpInfo = null; + } + public void setSelectedNode(DumpInfo dumpInfo) { if (this.selectedDumpInfo == dumpInfo) { skipNextScroll = false;