]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Bug: mesh is not destructed (leaks) after element selection.
authoreap <eap@opencascade.com>
Fri, 19 Jul 2013 14:28:59 +0000 (14:28 +0000)
committereap <eap@opencascade.com>
Fri, 19 Jul 2013 14:28:59 +0000 (14:28 +0000)
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

index 75c9574a3c27427c7cadee7992502380d3cfdbad..e9c8bd6fea4aa5a571e078c8045244dc937a354b 100644 (file)
@@ -47,6 +47,7 @@
 #include <vtkCellPicker.h>
 
 #include <vtkProperty.h>
+#include <vtkProp3DCollection.h>
 
 // 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();
   }