--- a/src/Pure/General/graphics_file.scala Mon Dec 03 12:30:37 2018 +0100
+++ b/src/Pure/General/graphics_file.scala Mon Dec 03 14:59:42 2018 +0100
@@ -58,8 +58,8 @@
{
import com.lowagie.text.{Document, Rectangle}
- val out = new BufferedOutputStream(new FileOutputStream(file))
- try {
+ using(new BufferedOutputStream(new FileOutputStream(file)))(out =>
+ {
val document = new Document()
try {
document.setPageSize(new Rectangle(width, height))
@@ -76,8 +76,7 @@
cb.addTemplate(tp, 1, 0, 0, 1, 0, 0)
}
finally { document.close() }
- }
- finally { out.close }
+ })
}