From 1bfbdb86e7f69cfe078f15bc81a6b94ffca811ad Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 1 Jul 2005 15:02:48 +0000 Subject: [PATCH] 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 --- deal.II/base/source/exceptions.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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; + } } -- 2.39.5