[vtkusers] vtkSmartPointer reintiatiation

ran kor1581 at gmail.com
Mon Mar 12 08:02:41 EDT 2018


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


More information about the vtkusers mailing list