[vtkusers] Delete problems

Dominik Szczerba domi at vision.ee.ethz.ch
Sat Jul 15 06:00:03 EDT 2006

Mathieu, Amy, Utkarsh,
Thank you all for your hint on smart pointers, I am now perfectly fine 
with them. However, as I understand now, I cannot explicitly free the 
memory occupied by a big dataset I am not going to use anymore, is that 
correct? I am thinking of a solution, is the below OK to use?

{//scope to use a lot of memory
   vtkSmartPointer<...> = New();
   //huge dataset occupies memory only in this scope
   //do something with the dataset
//memory automatically released without Delete()

Or are there any better solutions?
Thanks for any hints,

Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich

More information about the vtkusers mailing list