From: wolf Date: Fri, 1 Jul 2005 15:02:48 +0000 (+0000) Subject: Add a copy constructor. Don't copy the stacktrace to avoid double X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bfbdb86e7f69cfe078f15bc81a6b94ffca811ad;p=dealii-svn.git Add a copy constructor. Don't copy the stacktrace to avoid double de-allocation problems. git-svn-id: https://svn.dealii.org/trunk@11039 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/exceptions.cc b/deal.II/base/source/exceptions.cc index d91bc430ad..4a9f898fe0 100644 --- a/deal.II/base/source/exceptions.cc +++ b/deal.II/base/source/exceptions.cc @@ -48,10 +48,27 @@ ExceptionBase::ExceptionBase (const char* f, const int l, const char *func, +ExceptionBase::ExceptionBase (const ExceptionBase &exc) + : + std::exception (exc), + file(exc.file), line(exc.line), + function(exc.function), cond(exc.cond), exc(exc.exc), + // don't copy stacktrace to + // avoid double de-allocation + // problem + stacktrace (0), + n_stacktrace_frames (0) +{} + + + ExceptionBase::~ExceptionBase () throw () { if (stacktrace != 0) - free (stacktrace); + { + free (stacktrace); + stacktrace = 0; + } }