From: apo Date: Mon, 10 Oct 2005 05:37:54 +0000 (+0000) Subject: To provide correct memory menegement - call VTKViewer_Actor::RemoveFromRenderer metho... X-Git-Tag: BR-D5-38-2003_D2005-12-10~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7d5dd41dec1d60653ccb3ff081f70d460a51bd6b;p=modules%2Fgui.git To provide correct memory menegement - call VTKViewer_Actor::RemoveFromRenderer method before destruction of the SVTK_Renderer instance --- diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index a63f35e65..b69620b6b 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -125,6 +125,14 @@ SVTK_Renderer ::~SVTK_Renderer() { if(MYDEBUG) INFOS("~SVTK_Renderer() - "<GetActors(); + anActors->InitTraversal(); + while(vtkActor* anAct = anActors->GetNextActor()){ + if(VTKViewer_Actor* anActor = dynamic_cast(anAct)){ + anActor->RemoveFromRender(GetDevice()); + anActor->SetTransform(NULL); + } + } }