From: apo Date: Mon, 6 Feb 2006 07:21:24 +0000 (+0000) Subject: Fix for - Bug IPAL11488 X-Git-Tag: T_merge_to_HEAD_20060207~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b14053cfd6fc2735189ed46cd6829a0a5366d005;p=modules%2Fgui.git 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) --- 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(); }