#798 close file streams after export

This commit is contained in:
2015-02-11 18:26:22 +01:00
parent 4106f764bf
commit f2922421cb
8 changed files with 45 additions and 37 deletions
@@ -85,15 +85,9 @@ public class BMPFile extends Component {
public static void saveBitmap(Image image, File file) throws IOException {
BMPFile b = new BMPFile();
b.fo = new FileOutputStream(file);
try {
try (FileOutputStream fos = new FileOutputStream(file)) {
b.fo = fos;
b.save(image, image.getWidth(null), image.getHeight(null));
} finally {
try {
b.fo.close();
} catch (Exception ex) {
// ignore
}
}
}
/*