]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Plug a small memory leak, where we leaked 8 or 12 bytes per declared parameter.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 28 Nov 2001 08:17:17 +0000 (08:17 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 28 Nov 2001 08:17:17 +0000 (08:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@5286 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/parameter_handler.cc
deal.II/doc/news/2001/c-3-2.html

index 823a18414563f158284ed31b5fd9e52eda2e1c09..2c3d8025789ece43fcfe44644641a6881ab15cd3 100644 (file)
@@ -1076,6 +1076,14 @@ ParameterHandler::memory_consumption () const
 
 ParameterHandler::Section::~Section () 
 {
+                                  // first release the memory pointed
+                                  // to by the second component of
+                                  // the pair, since we became owner
+                                  // of that memory through the
+                                  // clone() call
+  for (EntryType::iterator q=entries.begin(); q!=entries.end(); ++q)
+    delete q->second.second;
+                                  // then clear entire map
   entries.clear ();
 
   std::map<std::string, Section*>::iterator p;
index 5cc40a9cabca4f162244ab2aae95950ee559fbf3..d93386b97aeefaaee012e01255a311ff5c42d9ed 100644 (file)
@@ -67,6 +67,14 @@ documentation, etc</a>.
 <h3>base</h3>
 
 <ol>
+  <li> <p>
+       Fixed: In the <code class="class">ParameterHandler</code>
+       class, we leaked 8 or 12 bytes of memory per declared
+       parameter. This is now fixed.
+       <br>
+       (WB 2001/11/28)
+       </p>
+
   <li> <p>
        New: <code class="class">Functions::CutOffFunctionCinfty</code>,
        <code class="class">Functions::CutOffFunctionW1</code>, and

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.