[vtkusers] Deleting ImageData Inside Loop

matheus_viana vianamp at gmail.com
Mon Jun 18 17:29:39 EDT 2012


Hi Guys,

I've a code that looks like that:

for (int i=100;i--;) {
	vtkStructuredPointsReader *Reader = vtkStructuredPointsReader::New();
	structured_dataset -> SetFileName("ImageData001.vtk");
	structured_dataset -> Update();

	vtkImageData *ImageData = vtkImageData::New();
	ImageData = structured_dataset -> GetOutput();
	ImageData -> Update();

	/**
		working on the ImageData
	**/

	ImageData -> Delete();
}

This code used to work well in VTK4, but in VTK5 it crashes at line
ImageData -> Delete(); Commenting this line the code runs well, but the
memory is not released at each interaction.

Do you guys know how to solve that? Is one possibility use the class
vtkSmartPointer? If so, how to do that?

Thanks in advance,
Matheus Viana

--
View this message in context: http://vtk.1045678.n5.nabble.com/Deleting-ImageData-Inside-Loop-tp5713986.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list