<div dir="ltr"><div><div><div>Dears,<br><br></div>I'm trying to free a SmartPointer of a vtkActor as mySmartPointer = NULL, but I get "segmentation faults" or "corrupted double-linked list"<br></div>
Could you please suggest me how to debug the issue?<br></div><br clear="all"><div><div><div><div><div><font size="1"><font><br>More details:<br>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):<br>
</font></font></div><div><br> vtkActorCollection * actorCollection = renderer->GetActors();<br> unsigned int numberOfItems=actorCollection -> GetNumberOfItems();<br><br> bool flag = true;<br><br> int i=0;<br>
while ( i < numberOfItems )<br> {<br> vtkSmartPointer<vtkActor> a=vtkActor::SafeDownCast ( actorCollection -> GetItemAsObject ( i ) );<br><br> if ( double ( a->GetProperty()->GetSpecular() ) == s )<br>
{<br> renderer -> RemoveActor ( a );<br> numberOfItems--;<br> }<br> else<br> ++i;<br> } <br></div><div><font size="1"><font><br></font></font></div><div><font size="1"><font>then I reset the pointer in another class, getting the error.<br>
<br></font></font></div><div><font size="1"><font>Thanks a lot<br><br></font></font></div><div><font size="1"><font>Luca <br></font></font></div><div><font size="1"><font><br>---<br></font></font><br></div>
</div></div></div></div></div>