mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 22:50:46 +00:00
#798 close file streams after export
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user