[vtkusers] memory leak in vtkConstrainedPointHandleRepresentation VTK 5.8.0

Alex Malyushytskyy alexmalvtk at gmail.com
Mon May 7 23:35:16 EDT 2012


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