vtkSmartPointer reintiatiation

classic Classic list List threaded Threaded
1 message Options
ran
Reply | Threaded
Open this post in threaded view
|

vtkSmartPointer reintiatiation

ran
Hello,
I'm using vtkSmartPointer to hold a vtkBorderWidget object of a class member
variable and instantiates an object in a member function of the class. The
member function call which will result in vtkSmartPointer new object
instantiation may occur multiple times in the lifetime of my Class object.
In this do I need to call delete method in vtkSmartPointer before each
re-installation or will it be deleted automatically when vtkSmartPointer
<>:: New call? or I need to use a normal pointer in this case?
Example of my case:
Class
{
private:
           vtkSmartPointer <vtkBorderWidget > m_vtkBox;
public:
         void DeleteOldBoxAndCreateNewBox()
         {
               m_vtkBox = vtkSmartPointer <vtkBorderWidget >::New();
          }
};



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers