]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
To provide correct memory menegement - call VTKViewer_Actor::RemoveFromRenderer metho...
authorapo <apo@opencascade.com>
Mon, 10 Oct 2005 05:37:54 +0000 (05:37 +0000)
committerapo <apo@opencascade.com>
Mon, 10 Oct 2005 05:37:54 +0000 (05:37 +0000)
src/SVTK/SVTK_Renderer.cxx

index a63f35e6564e0ce83daacf85c23718e1abf7c6a0..b69620b6bae651286b620175c944385f9e2018d2 100644 (file)
@@ -125,6 +125,14 @@ SVTK_Renderer
 ::~SVTK_Renderer()
 {
   if(MYDEBUG) INFOS("~SVTK_Renderer() - "<<this);
+  vtkActorCollection* anActors = GetDevice()->GetActors();
+  anActors->InitTraversal();
+  while(vtkActor* anAct = anActors->GetNextActor()){
+    if(VTKViewer_Actor* anActor = dynamic_cast<VTKViewer_Actor*>(anAct)){
+      anActor->RemoveFromRender(GetDevice());
+      anActor->SetTransform(NULL);
+    }
+  }
 }