From 51403123345da1c6bd23efa6e9ced862eddc10a7 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Mon, 6 Feb 2012 06:46:41 +0000
Subject: [PATCH] fix memory leak

[[Imported from SVN: r8400]]
---
 test/cosseratenergytest.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/cosseratenergytest.cc b/test/cosseratenergytest.cc
index a3b2042b..1ad6372f 100644
--- a/test/cosseratenergytest.cc
+++ b/test/cosseratenergytest.cc
@@ -202,7 +202,7 @@ void testFrameInvariance()
         v[i] = i;
     factory.insertElement(GeometryType(GeometryType::simplex,dim), v);
 
-    const GridType* grid = factory.createGrid();
+    const std::auto_ptr<GridType> grid(factory.createGrid());
     
     // //////////////////////////////////////////////////////////
     //  Test whether the energy is invariant under isometries
@@ -222,7 +222,7 @@ void testFrameInvariance()
         for (int j=0; j<dim+1; j++)
             coefficients[j] = testPoints[index[j]];
 
-        testEnergy<GridType>(grid, coefficients);
+        testEnergy<GridType>(grid.get(), coefficients);
         
     }
     
-- 
GitLab