]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed a memory leak in destructor when working with Trilinos.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 24 Sep 2009 15:42:14 +0000 (15:42 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 24 Sep 2009 15:42:14 +0000 (15:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@19528 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/log.cc

index 4790aadb0dba556eeaa43e6641b937d7816e93d4..304cb68910e18f1c9a9085a536938e1b87217cd2 100644 (file)
@@ -96,7 +96,11 @@ LogStream::~LogStream()
                                   // object
 #ifdef DEAL_II_USE_TRILINOS
   if (this == &deallog)
-    (new stream_map_type())->swap (outstreams);
+    {
+      stream_map_type * dummy = new stream_map_type();
+      dummy->swap (outstreams);
+      delete dummy;
+    }
 #endif
 }
 

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.