From 742676015387e7e4431aed34f79e3b574a12f118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 12 Mar 2021 18:58:02 +0100 Subject: [PATCH] Properly handling close all --- .../jpexs/decompiler/flash/gui/MainPanel.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index fdb4bf9d9..6a8a753a4 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -993,15 +993,25 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se swfs.clear(); oldItem = null; clear(); - updateUi(); - + updateUi(); + + List swfsToClose = new ArrayList<>(); for (SWFList swfList : swfsLists) { - List swfs2 = new ArrayList<>(swfList); - for (SWF swf : swfs2) { - swf.clearTagSwfs(); + swfsToClose.addAll(swfList); + for (SWF swf : swfList) { + Main.populateSwfs(swf, swfsToClose); } } + for (SWF swf : swfsToClose) { + swf.clearTagSwfs(); + } + + refreshTree(); + + mainMenu.updateComponents(null); + previewPanel.clear(); + return true; }