<br><div class="gmail_quote">On Fri, Dec 18, 2009 at 6:24 AM, hampycalc <span dir="ltr">&lt;<a href="mailto:i.am.tom.hampshire@googlemail.com">i.am.tom.hampshire@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
The operating system will free all application memory when the thread is<br>
terminated, so all memory assigned to your vtk objects will also be freed.<br>
If you don&#39;t delete your objects, you will only get memory leaks while the<br>
application is running. If you are just running a short script you *could*<br>
not bother deleting your objects.... although it is good practice to do so.<br>
<br>
Regards<br>
<div><div></div><div class="h5"><br><br></div></div></blockquote><div><br>Current practice is to use smart pointers and you don&#39;t have to worry about deleting the objects.<br><br>Simply change<br><br>vtkClass* class = vtkClass::New();<br>
<br>to <br><br>#include &lt;vtkSmartPointer.h&gt;<br>vtkSmartPointer&lt;vtkClass&gt; class = vtkSmartPointer&lt;vtkClass&gt;::New();<br><br>There is a short tutorial here: <a href="http://www.vtk.org/Wiki/Smart_Pointers">http://www.vtk.org/Wiki/Smart_Pointers</a><br>
<br clear="all">Thanks,<br><br>David <br></div></div>