From c87fee7088710002d990b217af2aab9cce5b2195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 17 May 2025 10:50:55 +0200 Subject: [PATCH] Fixed: AS1/2 debugger - deletion of SWD file after debugging --- CHANGELOG.md | 1 + src/com/jpexs/decompiler/flash/gui/Main.java | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5713b295..fe40c09e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Fixed - Resize export dialogs labels to match localized strings +- AS1/2 debugger - deletion of SWD file after debugging ## [23.0.1] - 2025-05-16 ### Fixed diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 843ce40d8..623940944 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -451,13 +451,13 @@ public class Main { private static interface SwfPreparation { - public SWF prepare(SWF swf, String swfHash) throws InterruptedException; + public SWF prepare(SWF swf, String swfHash, List tempFiles) throws InterruptedException; } private static class SwfRunPrepare implements SwfPreparation { @Override - public SWF prepare(SWF swf, String swfHash) throws InterruptedException { + public SWF prepare(SWF swf, String swfHash, List tempFiles) throws InterruptedException { if (Configuration.autoOpenLoadedSWFs.get()) { if (!DebuggerTools.hasDebugger(swf)) { DebuggerTools.switchDebugger(swf); @@ -477,7 +477,7 @@ public class Main { } @Override - public SWF prepare(SWF instrSWF, String swfHash) throws InterruptedException { + public SWF prepare(SWF instrSWF, String swfHash, List tempFiles) throws InterruptedException { EventListener prepEventListener = new EventListener() { @Override public void handleExportingEvent(String type, int index, int count, Object data) { @@ -539,6 +539,7 @@ public class Main { } else { instrSWF.generateSwdFile(swdFile, getPackBreakPoints(true, swfHash), swfHash); } + tempFiles.add(swdFile); } } } catch (IOException ex) { @@ -583,7 +584,9 @@ public class Main { } } if (prep != null) { - instrSWF = prep.prepare(instrSWF, swfHash); + List prepTempFiles = new ArrayList<>(); + instrSWF = prep.prepare(instrSWF, swfHash, prepTempFiles); + tempFiles.addAll(prepTempFiles); } try (FileOutputStream fos = new FileOutputStream(toPrepareFile)) { instrSWF.saveTo(fos);