hi,<br><br>thanks.. then wat about the actor?? should it be removed from the renderer and then, deleted or <br>if i delete, it is directly removed from the renderer??<br><br>Thanks<br><blockquote><br>---------- Original message ----------<br>From:"Bill Lorensen"&lt; bill.lorensen@gmail.com &gt;<br>Date: 25 Jun 10 18:23:59<br>Subject: Re: [vtkusers] What exactly happens in this scenario?<br>To: logic_cube &lt;John.Fraser@icr.ac.uk&gt;<br><br>In the destructor? Technically, yes. But it won't matter.<br><br>On Fri, Jun 25, 2010 at 8:51 AM, logic_cube &lt;John.Fraser@icr.ac.uk&gt; wrote:<br>&gt;<br>&gt; Shouldn't it be like this?<br>&gt;<br>&gt; if (elementNumberActor != NULL)<br>&gt; {<br>&gt; elementNumberActor-&gt;Delete();<br>&gt; elementNumberActor = NULL;<br>&gt; }<br>&gt;<br>&gt;<br>&gt;<br>&gt; Bill Lorensen-2 wrote:<br>&gt;&gt;<br>&gt;&gt; Yes, it will leak.<br>&gt;&gt;<br>&gt;&gt; To prevent the leak,, in your constructor,<br>&gt;&gt; elementNumberActor = NULL;<br>&gt;&
 gt;<br>&gt;&gt; In DisplayElementNumbers() before assigning the actor,<br>&gt;&gt; if (elementNumberActor != NULL)<br>&gt;&gt; {<br>&gt;&gt; elementNumberActor-&gt;Delete();<br>&gt;&gt; }<br>&gt;&gt;<br>&gt;&gt; In the destuctor,<br>&gt;&gt; if (elementNumberActor != NULL)<br>&gt;&gt; {<br>&gt;&gt; elementNumberActor-&gt;Delete();<br>&gt;&gt; }<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt; --<br>&gt; View this message in context: &lt;a href="http://old.nabble.com/What-exactly-happens-in-this-scenario--tp28991361p28991987.html" target="_blank"&gt;http://old.nabble.com/What-exactly-happens-in-this-scenario--tp28991361p28991987.html&lt;/a&gt;<br>&gt; Sent from the VTK - Users mailing list archive at Nabble.com.<br>&gt;<br>&gt; _______________________________________________<br>&gt; Powered by &lt;a href="http://www.kitware.com" target="_blank"&gt;www.kitware.com&lt;/a&gt;<br>&gt;<br>&gt; Visit other Kitware open-source projects at &lt;a href="http://www.kitware.com/opensource/opensou
 rce.html" target="_blank"&gt;http://www.kitware.com/opensource/opensource.html&lt;/a&gt;<br>&gt;<br>&gt; Please keep messages on-topic and check the VTK FAQ at: &lt;a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank"&gt;http://www.vtk.org/Wiki/VTK_FAQ&lt;/a&gt;<br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; &lt;a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank"&gt;http://www.vtk.org/mailman/listinfo/vtkusers&lt;/a&gt;<br>&gt;<br>_______________________________________________<br>Powered by &lt;a href="http://www.kitware.com" target="_blank"&gt;www.kitware.com&lt;/a&gt;<br><br>Visit other Kitware open-source projects at &lt;a href="http://www.kitware.com/opensource/opensource.html" target="_blank"&gt;http://www.kitware.com/opensource/opensource.html&lt;/a&gt;<br><br>Please keep messages on-topic and check the VTK FAQ at: &lt;a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank"&gt;http://www.vtk.org/Wiki/VTK_FAQ&lt;/a&gt;<br><br>
 Follow this link to subscribe/unsubscribe:<br>http://www.vtk.org/mailman/listinfo/vtkusers<br></blockquote><br><br><div style="border-top:1px dashed #ccc; border-bottom:1px dashed #ccc; padding:5px;"><a href="http://mail.in.com/mails/new_reg.php?utm_source=invite&utm_medium=outgoing" style="font:13px arial; color:#1E56A1; text-decoration:none;">Get Yourself a cool, short <b>@in.com</b> Email ID now!</a></div>