From 7d5dd41dec1d60653ccb3ff081f70d460a51bd6b Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 10 Oct 2005 05:37:54 +0000 Subject: [PATCH] To provide correct memory menegement - call VTKViewer_Actor::RemoveFromRenderer method before destruction of the SVTK_Renderer instance --- src/SVTK/SVTK_Renderer.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) 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); + } + } } -- 2.39.2