From 6224eec86a923e6e53059829fd5f2bb2147c3ca9 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 19 Jul 2013 14:28:59 +0000 Subject: [PATCH] Bug: mesh is not destructed (leaks) after element selection. In RemoveActor(), remove an actor from pickers as well + while ( int i = myCellPicker->GetActors()->IsItemPresent( theActor )) + myCellPicker->GetActors()->RemoveItem( i-1 ); --- 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 75c9574a3..e9c8bd6fe 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -47,6 +47,7 @@ #include #include +#include // undefining min and max because CASCADE's defines them and // it clashes with std::min(), std::max() included in utilities.h @@ -283,6 +284,16 @@ SVTK_Renderer anActor->RemoveFromRender(GetDevice()); + while ( int i = myPointPicker->GetProp3Ds()->IsItemPresent( theActor )) + myPointPicker->GetProp3Ds()->RemoveItem( i-1 ); + while ( int i = myCellPicker->GetProp3Ds()->IsItemPresent( theActor )) + myCellPicker->GetProp3Ds()->RemoveItem( i-1 ); + + while ( int i = myPointPicker->GetActors()->IsItemPresent( theActor )) + myPointPicker->GetActors()->RemoveItem( i-1 ); + while ( int i = myCellPicker->GetActors()->IsItemPresent( theActor )) + myCellPicker->GetActors()->RemoveItem( i-1 ); + if(theIsAdjustActors) AdjustActors(); } -- 2.39.2