<div dir="ltr"><div><div>Thanks Cory. That helped.<br><br><br></div>Regards,<br></div>Bikash<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 8:48 AM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Bikash,<div><br></div><div>VTK objects are managed by a garbage collector which does all the deleting for you. To let VTK know you are done with an object, you can call</div><div><br></div><div>object->Delete();</div><div><br></div><div>If this is the last reference to the object, the garbage collector will delete it for you. If, however, a reference to the object is held by some other object, it will not be garbage collected. That's why code like the following is safe:</div><div><br></div><div>vtkSphereSource* source = vtkSphereSource::New()</div><div>otherFilter->SetInputConnection( source->GetOutputPort() );</div><div>source->Delete();</div><div><br></div><div>HTH,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Jul 23, 2015 at 8:44 AM, Bikash Kanungo <span dir="ltr"><<a href="mailto:bikash@umich.edu" target="_blank">bikash@umich.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hi,<br><br></div>I'm creating vtkHexahedron(s) using the 
New() public member function. The resultant object is pointed by a base 
vtkCell  pointer. Since the destructors of both vtkHexahedron and 
vtkCell are protected member functions, is there a way to de-allocate 
the memory occupied by the object created by New()?<br><br></div>Thanks,<br></div>Bikash<span><font color="#888888"><br clear="all"><br>-- <br><div><div dir="ltr"><div><div><div><div><font color="#666666">Bikash S. Kanungo<br></font></div><font color="#666666">PhD Student<br></font></div><font color="#666666">Computational Materials Physics Group<br></font></div><font color="#666666">Mechanical Engineering <br></font></div><font color="#666666">University of Michigan<br><br></font></div></div>
</font></span></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><div><font color="#666666">Bikash S. Kanungo<br></font></div><font color="#666666">PhD Student<br></font></div><font color="#666666">Computational Materials Physics Group<br></font></div><font color="#666666">Mechanical Engineering <br></font></div><font color="#666666">University of Michigan<br><br></font></div></div>
</div>