]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a copy constructor. Don't copy the stacktrace to avoid double
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Jul 2005 15:02:48 +0000 (15:02 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Jul 2005 15:02:48 +0000 (15:02 +0000)
de-allocation problems.

git-svn-id: https://svn.dealii.org/trunk@11039 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/exceptions.cc

index d91bc430add2cf7b9b462e4935d2cd5ed0e9a5d1..4a9f898fe09657c2605572a5b552211f808df796 100644 (file)
@@ -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;
+    }
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.