Salome HOME
Issue #2112 performance for partition
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Remove.cpp
index a1c7bcfda295ab77636711299d7130911498015e..7bc6f3a1cc358ce8a59614e256de426aadd7c648 100644 (file)
@@ -27,14 +27,15 @@ void PartSetPlugin_Remove::execute()
   if (aPart.get()) {
     FeaturePtr aFeature = aRoot->feature(aPart);
     if (aFeature) {
-      // do remove
-      aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->value()->close();
+      // do remove, but don't do real close (features are erased without persistence changes
+      // document remove may be undoed)
+      // aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->value()->close();
       std::set<std::shared_ptr<ModelAPI_Feature> > aRefFeatures;
       aRoot->refsToFeature(aFeature, aRefFeatures);
       if (aRefFeatures.empty()) {
         aRoot->removeFeature(aFeature);
-        // the redisplay signal should be flushed in order to erase the feature presentation in the viewer
-        // after removeFeature from the document
+        // the redisplay signal should be flushed in order to erase the feature presentation
+        // in the viewer after removeFeature from the document
         Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
       }
     }