Fixed segfault in destructor when chaining 3 exceptions or more.

This commit is contained in:
Vincent Richard 2005-12-05 17:35:51 +00:00
parent 1d1a9cf604
commit 2cb8fef483
3 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,10 @@ VERSION 0.8.1cvs
2005-12-04 Vincent Richard <vincent@vincent-richard.net>
* 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).

View File

@ -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);

View File

@ -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.