Salome HOME
Fix for creation in GUI and unit-test for the issue #2681
[modules/shaper.git] / src / Model / Model_Session.cpp
index a7a032eea1b9ba564266f94911f57578cd2d688a..a22db3780ba50741c258ef66f0e94007c4118420 100644 (file)
@@ -72,6 +72,10 @@ bool Model_Session::save(const char* theFileName, std::list<std::string>& theRes
 void Model_Session::closeAll()
 {
   Model_Application::getApplication()->deleteAllDocuments();
+  static const Events_ID aDocChangeEvent = Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED);
+  static std::shared_ptr<Events_Message> aMsg(new Events_Message(aDocChangeEvent));
+  Events_Loop::loop()->send(aMsg);
+  Events_Loop::loop()->flush(aDocChangeEvent);
 }
 
 void Model_Session::startOperation(const std::string& theId, const bool theAttachedToNested)
@@ -471,10 +475,6 @@ void Model_Session::processEvent(const std::shared_ptr<Events_Message>& theMessa
         if (!aCases.empty()) {
           validators()->registerCase(aMsgAttr->featureId(), aMsgAttr->attributeId(), aCases);
         }
-        if (aMsgAttr->isGeometricalSelection()) {
-          validators()->registerGeometricalSelection(aMsgAttr->featureId(),
-                                                     aMsgAttr->attributeId());
-        }
       }
     }
     // plugins information was started to load, so, it will be loaded