]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for - Bug IPAL11488
authorapo <apo@opencascade.com>
Mon, 6 Feb 2006 07:21:24 +0000 (07:21 +0000)
committerapo <apo@opencascade.com>
Mon, 6 Feb 2006 07:21:24 +0000 (07:21 +0000)
  SIGSEGV detected after edit Scalar Map
(It is forbiden to modify a vtkCollection in the same time as you iterates through it)

src/SVTK/SVTK_Renderer.cxx

index 09249c166a34b2c5ddb46d0a29ec880c5b3bc5a0..cad43a139ad925709e6a2317a4c09b14acc79017 100644 (file)
@@ -155,12 +155,23 @@ SVTK_Renderer
 ::~SVTK_Renderer()
 {
   vtkActorCollection* anActors = GetDevice()->GetActors();
+  vtkActorCollection* anActors2 = vtkActorCollection::New();
+
   anActors->InitTraversal();
   while(vtkActor* anAct = anActors->GetNextActor()){
+    if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
+      anActors2->AddItem(anActor);
+    }
+  }
+
+  anActors2->InitTraversal();
+  while(vtkActor* anAct = anActors2->GetNextActor()){
     if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
       RemoveActor(anActor);
     }
   }
+
+  anActors2->Delete();
 }