[vtkusers] Problem freeing memory
Gennady Khokhorin
gok at aerometric-ak.com
Mon Apr 21 13:30:16 EDT 2008
Cameron,
I experienced the same problem in the past and ended up with smart
pointers:
{
vtkSmartPointer<...> myObj = vtkSmartPointer<...>::New();
}
My guess some vtk items creates silently child objects down the
hierarchy tree.
Happy programming!
Gennady
_____
From: Cameron Burnett [mailto:w_e_b_m_a_s_t_e_r_6_9 at hotmail.com]
Sent: Monday, April 21, 2008 5:48 AM
To: vtkusers at vtk.org
Subject: [vtkusers] Problem freeing memory
Hi,
I'm currently trying to free the memory taken up by my DICOM loading
function (vtkDICOMImageReader). The problem is that I call Delete on
everything that I've instantiated, but the ~700MB still remains in the
RAM.
The vtkVolume that I read the object into is global, so I've got a
button that removes it from the renderer and then deletes it, like so...
this->pvtkRenderer->RemoveActor(this->volume);
this->pvtkRenderer->RemoveAllViewProps(); //for good
measure :)
this->volume->Delete();
What else would I have to do? I've called Delete on everything in the
load function, and I've deleted the volume object itself..... so.... I
don't know.
I realise that the Delete funtion only decreases the counter for that
object, but all i'm doing is loading in a DICOM object and deleting
it.... so nothing else should be using it.
Maybe there is a Cleanup function or something??
Thanks,
Cameron.
_____
Grab it. You dream job is up for grabs.
<http://mycareer.com.au/?s_cid=596065>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080421/0145865a/attachment.htm>
More information about the vtkusers
mailing list