[vtkusers] Memory management in VTK

David Doria daviddoria+vtk at gmail.com
Mon May 10 20:23:26 EDT 2010

On Mon, May 10, 2010 at 11:52 AM, Benoist Laurent <benoist at ibpc.fr> wrote:

> Hi all,
> I've got a problem for freeing memory with VTK 5.2.
> In my program, I've got a function that allows to switch between a line
> representation and a sphere representations.
> Each time I switch, I pay attention to remove the actor from the renderer
> then delete the actor before initializing it again.
> But when I use Apple Instruments to check for memory leaks, I can see that
> there is not memory leak (good point) but that the memory usage increases
> every time I switch from lines to spheres (see picture).
> Does anyone have an idea of what am I doing wrong ?
> Any help would be appreciated.
> Thanks.
> Ben.

Have you tried using smart pointers? (
http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers) They take care of
everything automatically.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100510/261965a0/attachment.htm>

More information about the vtkusers mailing list