From b14053cfd6fc2735189ed46cd6829a0a5366d005 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 6 Feb 2006 07:21:24 +0000 Subject: [PATCH] Fix for - Bug IPAL11488 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 09249c166..cad43a139 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -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(anAct)){ + anActors2->AddItem(anActor); + } + } + + anActors2->InitTraversal(); + while(vtkActor* anAct = anActors2->GetNextActor()){ if(SALOME_Actor* anActor = dynamic_cast(anAct)){ RemoveActor(anActor); } } + + anActors2->Delete(); } -- 2.39.2