diff options
author | Vincent Richard <[email protected]> | 2005-12-05 17:35:51 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-12-05 17:35:51 +0000 |
commit | 2cb8fef483849ad7b2906e110cfc6516ea43bb9e (patch) | |
tree | 33ee45c5a3e65560b3be7815575ec9ccb45cb28e | |
parent | Fixed a bug in argument vector. (diff) | |
download | vmime-2cb8fef483849ad7b2906e110cfc6516ea43bb9e.tar.gz vmime-2cb8fef483849ad7b2906e110cfc6516ea43bb9e.zip |
Fixed segfault in destructor when chaining 3 exceptions or more.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/exception.cpp | 6 | ||||
-rw-r--r-- | vmime/exception.hpp | 2 |
3 files changed, 12 insertions, 0 deletions
@@ -4,6 +4,10 @@ VERSION 0.8.1cvs 2005-12-04 Vincent Richard <[email protected]> + * exception.{hpp|cpp}: fixed segfault in destructor when destroying + an exception chain with more than 2 elements (thanks to Bertrand + Benoit). + * posixChildProcess.cpp: fixed a bug in argument vector; last argument was not NULL (thanks to Bertrand Benoit). diff --git a/src/exception.cpp b/src/exception.cpp index 9cfd2201..b01fa033 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -46,6 +46,12 @@ exception::exception(const string& what, const exception& other) } +exception::exception(const exception& e) + : std::exception(), m_what(e.what()), m_other(e.m_other == NULL ? NULL : e.m_other->clone()) +{ +} + + exception::~exception() throw() { delete (m_other); diff --git a/vmime/exception.hpp b/vmime/exception.hpp index 04aa9d5a..7a394650 100644 --- a/vmime/exception.hpp +++ b/vmime/exception.hpp @@ -51,6 +51,8 @@ private: public: exception(const string& what, const exception& other = NO_EXCEPTION); + exception(const exception& e); + virtual ~exception() throw(); /** Return a description of the error. |