summaryrefslogtreecommitdiffstats
path: root/libdimensionxx/cookie-tmpfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libdimensionxx/cookie-tmpfile.cpp')
-rw-r--r--libdimensionxx/cookie-tmpfile.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libdimensionxx/cookie-tmpfile.cpp b/libdimensionxx/cookie-tmpfile.cpp
index 9e513e6..784e984 100644
--- a/libdimensionxx/cookie-tmpfile.cpp
+++ b/libdimensionxx/cookie-tmpfile.cpp
@@ -25,8 +25,10 @@
namespace Dimension
{
- // Close the tmpfile
- FILE_Cookie::~FILE_Cookie() { std::fclose(m_file); }
+ // FILE_Cookie pure virtual destructor
+ FILE_Cookie::~FILE_Cookie() {
+ fclose(file());
+ }
namespace
{
@@ -110,6 +112,9 @@ namespace Dimension
file(tmp);
}
+ // No-op iFILE_Cookie destructor
+ iFILE_Cookie::~iFILE_Cookie() { }
+
// Make an output FILE_Cookie
oFILE_Cookie::oFILE_Cookie(std::ostream& ostr)
: m_ostr(&ostr)
@@ -146,4 +151,7 @@ namespace Dimension
// Set the FILE*
file(tmp);
}
+
+ // No-op ioFILE_Cookie destructor
+ ioFILE_Cookie::~ioFILE_Cookie() { }
}