From 48a36eb148fc7475012e7f8058d26308ab919592 Mon Sep 17 00:00:00 2001 From: Simon Mitternacht Date: Wed, 5 May 2021 20:47:27 +0200 Subject: [PATCH] Close file when done in CIF output. --- src/cif.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cif.cc b/src/cif.cc index 62d2039..ec6799b 100644 --- a/src/cif.cc +++ b/src/cif.cc @@ -744,5 +744,11 @@ int freesasa_export_tree_to_cif(const char *filename, std::ostream out(buf); - return write_result(out, root, options); + int ret = write_result(out, root, options); + + if (filename != NULL) { + fout.close(); + } + + return ret; }