<div class="gmail_quote">On Mon, May 10, 2010 at 11:52 AM, Benoist Laurent <span dir="ltr">&lt;<a href="mailto:benoist@ibpc.fr">benoist@ibpc.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Hi all,<div><br></div><div>I&#39;ve got a problem for freeing memory with VTK 5.2.</div><div>In my program, I&#39;ve got a function that allows to switch between a line representation and a sphere representations.</div>
<div>Each time I switch, I pay attention to remove the actor from the renderer then delete the actor before initializing it again.</div><div><br></div><div>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).</div>
<div><br></div><div>Does anyone have an idea of what am I doing wrong ?</div><div><br></div><div>Any help would be appreciated.</div><div>Thanks.</div><div>Ben.</div><div></div></div></blockquote></div><br><div>Have you tried using smart pointers? (<a href="http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers">http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers</a>) They take care of everything automatically.</div>
<div><br clear="all">Thanks,<br><br>David<br></div>