Salome HOME
Issue #1112 tab key doesn't work on the last field of left panels
[modules/shaper.git] / src / Model / Model_Document.cpp
index d96069a65fcac2111fd5972d2958e98be9d859ac..ec071b40300a35ca2d586f902764a204002897ed 100755 (executable)
@@ -295,6 +295,10 @@ void Model_Document::close(const bool theForever)
     mySelectionFeature.reset();
   } else {
     setCurrentFeature(FeaturePtr(), false); // disables all features
+    // update the OB: features are disabled (on remove of Part)
+    Events_Loop* aLoop = Events_Loop::loop();
+    static Events_ID aDeleteEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
+    aLoop->flush(aDeleteEvent);
   }
 
   std::static_pointer_cast<Model_Session>(Model_Session::get())->setCheckTransactions(true);
@@ -866,6 +870,8 @@ const int Model_Document::index(std::shared_ptr<ModelAPI_Object> theObject)
 
 int Model_Document::size(const std::string& theGroupID)
 {
+  if (myObjs == 0) // may be on close
+    return 0;
   return myObjs->size(theGroupID);
 }