[vtkusers] memory leak in vtkConstrainedPointHandleRepresentation VTK 5.8.0

Alex Malyushytskyy alexmalvtk at gmail.com
Wed May 9 00:35:09 EDT 2012


Actually to get memory leak with code below you need to start interaction,
so add the following after the code below :

distanceWidget->On();

and click to add points,

It looks like memory leak is related to the Glyph3D usage,
but I could not find an exact place where it happens,

Any help is appreciated.

Alex


On Mon, May 7, 2012 at 8:35 PM, Alex Malyushytskyy <alexmalvtk at gmail.com> wrote:
> It looks like that there is a memory leak in
> vtkConstrainedPointHandleRepresentation .
> ( at least VTK 5.8.0, MSVS2010)
>
> I am trying to use vtkDistanceWidget which is initialized as:
>
>        vtkSmartPointer< vtkConstrainedPointHandleRepresentation > handleRep
> = vtkSmartPointer< vtkConstrainedPointHandleRepresentation >::New();
>        vtkSmartPointer< vtkDistanceRepresentation2D  > distanceRep =
> vtkSmartPointer< vtkDistanceRepresentation2D >::New();
>
>        distanceRep->SetHandleRepresentation( handleRep );
>
>        distanceRep->SetLabelFormat("%-#6.5g in");
>        distanceRep->RulerModeOff(  );
>        distanceRep->SetRulerDistance( 120. );
>
>        distanceWidget = vtkSmartPointer<vtkDistanceWidget>::New();
>        distanceWidget->SetInteractor( GetRenderWindow()->GetInteractor() );
>        distanceWidget->SetRepresentation( distanceRep );
>        distanceRep->InstantiateHandleRepresentation();
>        distanceWidget->CreateDefaultRepresentation();
>        distanceWidget->EnabledOff();
>
>
> When application exits I get VTK notification about memory leaks.
> If I replace vtkConstrainedPointHandleRepresentation with
> vtkPointHandleRepresentation2D
> there is no memory leak (but I do not get default behavior)
>
> Could anybody who has access to nightly version check if there were any patches?
>
> Regards,
>  Alex



More information about the vtkusers mailing list