diff --git a/CHANGELOG.md b/CHANGELOG.md index 760bdf7be..44555e87d 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 - [#1817] PDF export - now storing JPEG images without recompression to PNG +- [#1816] PDF export - leaking temporary files when frame has embedded texts ## [16.0.2] - 2022-11-01 ### Added @@ -2448,6 +2449,7 @@ All notable changes to this project will be documented in this file. [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 [#1817]: https://www.free-decompiler.com/flash/issues/1817 +[#1816]: https://www.free-decompiler.com/flash/issues/1816 [#1731]: https://www.free-decompiler.com/flash/issues/1731 [#1825]: https://www.free-decompiler.com/flash/issues/1825 [#1737]: https://www.free-decompiler.com/flash/issues/1737 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/DualPdfGraphics2D.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/DualPdfGraphics2D.java index 615458aa3..c33347698 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/DualPdfGraphics2D.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/DualPdfGraphics2D.java @@ -646,7 +646,7 @@ public class DualPdfGraphics2D extends Graphics2D implements BlendModeSetable, G } } else { FontExporter fe = new FontExporter(); - File tempFile; + File tempFile = null; try { tempFile = File.createTempFile("ffdec_font_export_", ".ttf"); fe.exportFont(font, FontExportMode.TTF, tempFile); @@ -656,6 +656,9 @@ public class DualPdfGraphics2D extends Graphics2D implements BlendModeSetable, G } catch (IOException ex) { Logger.getLogger(FrameExporter.class.getName()).log(Level.SEVERE, null, ex); } + if (tempFile != null && tempFile.exists()) { + tempFile.delete(); + } } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java index ec675b9c5..5098dd141 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java @@ -589,7 +589,7 @@ public class FrameExporter { } } else { FontExporter fe = new FontExporter(); - File tempFile; + File tempFile = null; try { tempFile = File.createTempFile("ffdec_font_export_", ".ttf"); fe.exportFont(font, FontExportMode.TTF, tempFile); @@ -599,6 +599,9 @@ public class FrameExporter { } catch (IOException ex) { Logger.getLogger(FrameExporter.class.getName()).log(Level.SEVERE, null, ex); } + if (tempFile != null && tempFile.exists()) { + tempFile.delete(); + } } }