[vtkusers] Cannot free a vtkSmartPointer
Luca Tersi
luca.tersi at unibo.it
Fri Feb 7 13:03:41 EST 2014
Dears,
I'm trying to free a SmartPointer of a vtkActor as mySmartPointer = NULL,
but I get "segmentation faults" or "corrupted double-linked list"
Could you please suggest me how to debug the issue?
More details:
I want to remove the actor from the renderer (I select it based on the
specular parameter s), and free a pointer to it (in another class):
vtkActorCollection * actorCollection = renderer->GetActors();
unsigned int numberOfItems=actorCollection -> GetNumberOfItems();
bool flag = true;
int i=0;
while ( i < numberOfItems )
{
vtkSmartPointer<vtkActor> a=vtkActor::SafeDownCast (
actorCollection -> GetItemAsObject ( i ) );
if ( double ( a->GetProperty()->GetSpecular() ) == s )
{
renderer -> RemoveActor ( a );
numberOfItems--;
}
else
++i;
}
then I reset the pointer in another class, getting the error.
Thanks a lot
Luca
---
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140207/67a7ce38/attachment.html>
More information about the vtkusers
mailing list