diff --git a/CHANGELOG.md b/CHANGELOG.md index e115c460e..ee6be1a95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. - [#2178] Undo on sprites - [#2176] Reset letterspacing on text import - Nullpointer on recent searches loader +- [#2177] Leftover process when invalid SWF opened - now main window is shown ## [20.1.0] - 2023-12-30 ### Added @@ -3372,6 +3373,7 @@ Major version of SWF to XML export changed to 2. [#2174]: https://www.free-decompiler.com/flash/issues/2174 [#2175]: https://www.free-decompiler.com/flash/issues/2175 [#2178]: https://www.free-decompiler.com/flash/issues/2178 +[#2177]: https://www.free-decompiler.com/flash/issues/2177 [#2100]: https://www.free-decompiler.com/flash/issues/2100 [#2123]: https://www.free-decompiler.com/flash/issues/2123 [#2119]: https://www.free-decompiler.com/flash/issues/2119 diff --git a/src/com/jpexs/decompiler/flash/gui/LoadingDialog.java b/src/com/jpexs/decompiler/flash/gui/LoadingDialog.java index 837268ce8..42ab7c059 100644 --- a/src/com/jpexs/decompiler/flash/gui/LoadingDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/LoadingDialog.java @@ -99,9 +99,7 @@ public class LoadingDialog extends AppDialog { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { - if (Main.shouldCloseWhenClosingLoadingDialog) { - System.exit(0); - } else if (worker != null) { + if (worker != null) { worker.cancel(true); } } diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 051fe910e..9f3c19953 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -183,8 +183,6 @@ public class Main { public static DebugLogDialog debugDialog; - public static boolean shouldCloseWhenClosingLoadingDialog; - private static Debugger flashDebugger; private static DebuggerHandler debugHandler = null; @@ -1660,12 +1658,15 @@ public class Main { } } - loadingDialog.setVisible(false); - shouldCloseWhenClosingLoadingDialog = false; - final SWF fswf = firstSWF; final Openable fopenable = firstOpenable; - View.execInEventDispatch(() -> { + View.execInEventDispatch(() -> { + if (mainFrame == null) { + Main.startWork(AppStrings.translate("work.creatingwindow") + "...", null); + ensureMainFrame(); + } + loadingDialog.setVisible(false); + if (mainFrame != null) { mainFrame.setVisible(true); } @@ -2844,7 +2845,6 @@ public class Main { if (filesToOpen != null && filesToOpen.length > 0) { initGui(); View.execInEventDispatch(() -> { - shouldCloseWhenClosingLoadingDialog = true; if (Configuration.allowOnlyOneInstance.get() && FirstInstance.openFiles(Arrays.asList(filesToOpen))) { //Try to open in first instance Main.exit(); } else {