summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-04-09 04:00:05 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-04-09 04:00:05 +0200
commit031fdb010e2e0565fa3c8e3d0b67e084233d2d9d (patch)
treec8f78ae029c88d4d1f1dbf379bf764e599bc7d6a
parent923ce33be1e33b2feda2839b61abca76ee3fcd90 (diff)
downloadsolar-031fdb010e2e0565fa3c8e3d0b67e084233d2d9d.tar
solar-031fdb010e2e0565fa3c8e3d0b67e084233d2d9d.zip
output: close output files
-rw-r--r--src/output.cpp5
-rw-r--r--src/output.hpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/output.cpp b/src/output.cpp
index d14b1b9..cc9d5f3 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -58,6 +58,11 @@ output_t::output_t(const generator_t *generator0, const char *header, const char
}
}
+output_t::~output_t() {
+ std::fclose(header_file);
+ std::fclose(source_file);
+}
+
void output_t::emit_tokens() {
if (tokens.empty())
return;
diff --git a/src/output.hpp b/src/output.hpp
index 913f123..e3d5b99 100644
--- a/src/output.hpp
+++ b/src/output.hpp
@@ -74,6 +74,7 @@ private:
public:
output_t(const generator_t *generator0, const char *header, const char *source);
+ ~output_t();
void write();
};