[vtkusers] How to release the memeory of props?

Helend zheng.bangyou at yahoo.com.cn
Sun Apr 12 09:26:35 EDT 2009


I need to redraw the vtkRenderer when users click the some place of window.
Firstly, the all props were deleted:
m_Renderer->RemoveAllViewProps();

Then, these codes were used to redraw the vtkRenderer 

vtkPoints           * pts             = vtkPoints::New();
vtkUnstructuredGrid * aTriangleGrid   = vtkUnstructuredGrid::New();
vtkDataSetMapper    * aTriangleMapper = vtkDataSetMapper::New();
vtkActor            * Actor        = vtkActor::New();

// some codes to create the Props

m_Renderer->AddViewProp( Actor );

pts->Delete();
aTriangleGrid->Delete();
aTriangleMapper->Delete();
Actor->Delete();

The memory was growing with redrawing the vtkRenderer 

I had tried "vtkSmartPointer", but the problem still existed.

How to fix this problem? 
Thank you very much!
-- 
View this message in context: http://www.nabble.com/How-to-release-the-memeory-of-props--tp23011060p23011060.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list