#798 close file streams after export

This commit is contained in:
honfika@gmail.com
2015-02-11 18:26:22 +01:00
parent 4106f764bf
commit f2922421cb
8 changed files with 45 additions and 37 deletions

View File

@@ -980,7 +980,9 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
}
try {
tempFile = File.createTempFile("ffdec_view_", ".swf");
swf.saveTo(new BufferedOutputStream(new FileOutputStream(tempFile)));
try (FileOutputStream fos = new FileOutputStream(tempFile)) {
swf.saveTo(new BufferedOutputStream(fos));
}
flashPanel.displaySWF(tempFile.getAbsolutePath(), backgroundColor, swf.frameRate);
} catch (IOException iex) {
Logger.getLogger(PreviewPanel.class.getName()).log(Level.SEVERE, "Cannot create tempfile", iex);