VTK
Use vtkObjectBase’s Function Delete To Free Object
Explore what will happen when we use delete on vtkSmartPointer<vtkActor> object. vtkSmartPointer<vtkActor> leftActor = vtkSmartPointer<vtkActor>::New(); leftActor->SetMapper( mapper ); //… void *ptr = leftActor.Get(); leftActor->GetProperty()->SetColor( 1, 0, 0 ); rightActor->GetProperty()->SetColor( 0, 1, 0 ); leftActor->Delete(); cout << “leftActor: ” << (void Read more…