mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-12 19:58:25 +00:00
Fixed #1816 PDF export - leaking temporary files when frame has embedded texts
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user