[vtkusers] calling destructors

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu Aug 25 09:00:29 EDT 2011


If this->imageData is a smart pointer, the delete will happen
automatically once it get out of scope.
But if you really want to delete the object at that point, you can do
something like that as well.

this->imageData = NULL;

On Thu, Aug 25, 2011 at 7:28 AM, Jothy <jothybasu at gmail.com> wrote:
> Hi all,
>
> This is  c++ question rather than a vtk one, sorry for that.
>
> If I use
>
> this->imageData=vtkSmartPointer<vtkImageData>::New();
>
> Should I call
>
> this-imageData->Delete() in the destructor of the class?
>
> Thanks
>
> Jothy
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list