#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

@@ -1815,7 +1815,9 @@ public final class SWF implements SWFContainerItem, Timelined {
@Override
public void run() throws IOException {
File f = new File(foutdir + File.separator + (fframes.get(fi) + 1) + ".png");
ImageHelper.write(frameImages.next(), "PNG", new FileOutputStream(f));
try (FileOutputStream fos = new FileOutputStream(f)) {
ImageHelper.write(frameImages.next(), "PNG", fos);
}
ret.add(f);
}
}, handler).run();