[Insight-developers] itkNeighborhood and leaks
Joshua Cates
cates@cs.utah.edu
Thu, 26 Jul 2001 14:21:48 -0600 (MDT)
Hi,
The only MLK I see associated with itkNeighborhood is 96 bytes in
itkDiscreteGaussianImageFilterTest. Are there other places that I am
overlooking? Oddly, this leak does not appear in the Irix run.
Josh.
_____________________________
Josh Cates
School of Computer Science
University of Utah
Email: cates@cs.utah.edu
Phone: (801) 587-7697
URL: www.cs.utk.edu/~cates
On Thu, 26 Jul 2001, Bill Hoffman wrote:
> Hi all,
>
> In looking at the purify errors, I noticed that some itkNeighborhood sub classes were being
> leaked in several places. Is there some reason why this class can not inherit from
> itkLightObject? If it did, it would be able to use the SmartPointer and not leak.
> I don't think that any of the classes in itk should use "new", they should all use
> class::New, there are several exceptions to this, but those exceptions are for classes
> that need to be very small, and passed around by value or on the stack,
> (in that case "new" would not be used.)
>
> As a rule for itk, no class should be using "new" or have a public constructor unless it is
> to be used on the stack or as part of an array.
>
>
>
> Here are the remaining tests that have leaks:
> itkDeformableTest
> itkDiscreteGaussianImageFilterTest
> itkExceptionObjectTest
> itkGibbsTest
> itkMRFLabellerTest
> itkSplineKernelTransformTest
> itkSupervisedClassifierTest
> itkVectorFuzzyConnectednessImageFilterTest
> itkVoronoiSegmentationImageFilterTest
> itkVoronoi2DDiagramTest
>
> Interestingly, if you grep in the source code for "new " *.txx *.cxx, most of the classes that
> use "new" are the ones that are leaking memory.
>
> -Bill
>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>