diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-11-27 12:18:24 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-11-27 12:45:21 +0000 |
commit | 565b80cc4a88ab420cf5e2138300856888ad9968 (patch) | |
tree | 01576f1cf9d1b0f6d0c496a8d80d6a5bfeea8859 /common/trace_file.cpp | |
parent | e64ba4980c20ba52f6b3a88bc817623052e6d0a8 (diff) |
Don't call overridden virtual methods from the base destructor.
It causes the program to terminate with "pure virtual method called"
error, as the derived class members are no longer accessible.
Diffstat (limited to 'common/trace_file.cpp')
-rw-r--r-- | common/trace_file.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/trace_file.cpp b/common/trace_file.cpp index 2210602..3657fd2 100644 --- a/common/trace_file.cpp +++ b/common/trace_file.cpp @@ -28,6 +28,7 @@ #include <assert.h> + using namespace trace; @@ -43,7 +44,8 @@ File::File(const std::string &filename, File::~File() { - close(); + // We can't invoke any overriden virtual method here anymore + assert(!m_isOpened); } |