MantisBT - ITK
View Issue Details
0011360ITKpublic2010-10-25 15:332010-10-25 20:08
kentwilliams 
alexandre gouaillard 
normalmajoralways
assignedopen 
ITK-4-A3 
 
backlog
0011360: itk::AutoPointer members in mesh cells leaking
Discovered while checking this bug report:

http://public.kitware.com/Bug/view.php?id=1033 [^]

valgrind is reporting memory leakes in the itkSimplexMeshToTriangleMeshFilterTest

The issue seems to be AutoPointers in the mesh cell classes somehow not being destroyed properly;
If you apply the patch below, which, by assigning 0 to the itk::SmartPointer instances that were leaking, the valgrind leak report goes away. This doesn't make any sense to me.

diff --git a/Testing/Code/BasicFilters/itkSimplexMeshToTriangleMeshFilterTest.cxx b/Testing/Code/BasicFilters/itkSimplexMeshToTriangleMeshFilterTest.cxx
index e74bc90..5d2da0b 100644
--- a/Testing/Code/BasicFilters/itkSimplexMeshToTriangleMeshFilterTest.cxx
+++ b/Testing/Code/BasicFilters/itkSimplexMeshToTriangleMeshFilterTest.cxx
@@ -74,6 +74,8 @@ int itkSimplexMeshToTriangleMeshFilterTest( int , char * [] )
   std::cout << "Back filtered Triangle Mesh: " << triangleMesh << std::endl;
 
   std::cout << "[TEST DONE]" << std::endl;
+ originalTriangleMesh = 0;
+ simplexFilter = 0;
   return EXIT_SUCCESS;
 
 }
No tags attached.
Issue History
2010-10-25 15:33kentwilliamsNew Issue
2010-10-25 15:33kentwilliamsSprint Status => backlog
2010-10-25 15:45Bradley LowekampNote Added: 0022684
2010-10-25 20:08Luis IbanezStatusnew => assigned
2010-10-25 20:08Luis IbanezAssigned To => alexandre gouaillard

Notes
(0022684)
Bradley Lowekamp   
2010-10-25 15:45   
Is it possible there was a circular dependency with the smart pointers?