<div dir="ltr"><div>Hi, you can read here about that topic <a href="http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers">http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers</a><br><br></div>HTH<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-29 18:00 GMT+02:00 Mingcheng Chen <span dir="ltr"><<a href="mailto:linyufly@gmail.com" target="_blank">linyufly@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>I am always prudent when using VTK, i. e. I never mix the smart pointer and normal pointer of VTK objects.<br><br></div>I have a concern. Suppose we have<br><br></div>vtkPolyData *mesh = some_function_which_returns_vtkPolyData_star(...);<br></div>vtkSmartPointer<vtkPolyData> mesh_ptr = vtkSmartPointer<vtkPolyData>(mesh);<br><br></div>we should do mesh_ptr->Delete() after, right?<br><br></div>However, can we do<br><br></div>vtkSmartPointer<vtkPolyData> mesh_ptr = vtkSmartPointer<vtkPolyData>(some_function_which_returns_vtkPolyData_star(...));<br><br>?<br><br></div>If we do that, how can we delete the reference count to the object before passing it to vtkSmartPointer?<br><br></div>Thanks!<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">-Mingcheng<br></font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>