[vtk-developers] Do I need to delete an object when I create a smart pointer of it?
linyufly at gmail.com
Sun Mar 29 12:00:14 EDT 2015
I am always prudent when using VTK, i. e. I never mix the smart pointer and
normal pointer of VTK objects.
I have a concern. Suppose we have
vtkPolyData *mesh = some_function_which_returns_vtkPolyData_star(...);
vtkSmartPointer<vtkPolyData> mesh_ptr = vtkSmartPointer<vtkPolyData>(mesh);
we should do mesh_ptr->Delete() after, right?
However, can we do
vtkSmartPointer<vtkPolyData> mesh_ptr =
If we do that, how can we delete the reference count to the object before
passing it to vtkSmartPointer?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtk-developers