[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,
regards,
Dominik

-- 
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list