Salome HOME
Bug PAL7444 - display mesh takes a lot of more memory in 2.1.0 than in 2.0.0.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_VTKUtils.cxx
index 8bd6cdce93832a9f149e319db1cdd6a6c52dabd4..89cebc3c456091b5c434993698eb8579379e459e 100644 (file)
@@ -244,6 +244,17 @@ namespace SMESH{
   void RemoveActor(QAD_StudyFrame *theStudyFrame, SMESH_Actor* theActor){
     if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(theStudyFrame)){
       aViewFrame->RemoveActor(theActor);
+      if(theActor->hasIO()){
+       Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+       if(anIO->hasEntry()){
+         std::string anEntry = anIO->getEntry();
+         QAD_Study* aStudy = theStudyFrame->getStudy();
+         int aStudyId = aStudy->getStudyId();
+         TVisualObjCont::key_type aKey(aStudyId,anEntry);
+         VISUAL_OBJ_CONT.erase(aKey);
+       }
+      }
+      theActor->Delete();
       aViewFrame->Repaint();
     }
   }