From 204457cd86adcb04207d10560687056d46a25932 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Fri, 2 Mar 2018 18:39:16 +0100
Subject: [PATCH] explicitly close output streams

---
 src/DynamicModel.cc | 2 ++
 src/StaticModel.cc  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc
index 9f206d63..2494b12a 100644
--- a/src/DynamicModel.cc
+++ b/src/DynamicModel.cc
@@ -4006,6 +4006,8 @@ DynamicModel::writeSetAuxiliaryVariables(const string &basename, const bool juli
          << comment << " Warning : this file is generated automatically by Dynare" << endl
          << comment << "           from model file (.mod)" << endl << endl
          << output_func_body.str();
+
+  output.close();
 }
 
 void
diff --git a/src/StaticModel.cc b/src/StaticModel.cc
index 11a033a8..1ef7bad5 100644
--- a/src/StaticModel.cc
+++ b/src/StaticModel.cc
@@ -2162,6 +2162,8 @@ StaticModel::writeSetAuxiliaryVariables(const string &basename, const bool julia
          << comment << " Warning : this file is generated automatically by Dynare" << endl
          << comment << "           from model file (.mod)" << endl << endl
          << output_func_body.str();
+
+  output.close();
 }
 
 void
-- 
GitLab