]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix crash in model when create fillet from a script in GUI.
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 16 Dec 2015 08:28:46 +0000 (11:28 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:05 +0000 (14:53 +0300)
src/Model/Model_Objects.cpp

index b34d47f142bb0285dd4f6fbd46122bcb29b3f598..f8ea0099ee299260e57f43c3a8520ac582a49d4c 100644 (file)
@@ -139,13 +139,19 @@ void Model_Objects::addFeature(FeaturePtr theFeature, const FeaturePtr theAfterT
     myFeatures.Bind(aFeatureLab, theFeature);
     // must be before the event sending: for OB the feature is already added
     updateHistory(ModelAPI_Feature::group());
+    // do not change the order:
+    // initData()
+    // sendUpdated()
+    // during python script with fillet constraint feature data should be
+    // initialized before using it in GUI
+
+    // must be after binding to the map because of "Box" macro feature that
+    // creates other features in "initData"
+    initData(theFeature, aFeatureLab, TAG_FEATURE_ARGUMENTS);
     // event: feature is added, mist be before "initData" to update OB correctly on Duplicate:
     // first new part, then the content
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
     ModelAPI_EventCreator::get()->sendUpdated(theFeature, anEvent);
-    // must be after binding to the map because of "Box" macro feature that 
-    // creates other features in "initData"
-    initData(theFeature, aFeatureLab, TAG_FEATURE_ARGUMENTS);
   } else { // make feature has not-null data anyway
     theFeature->setData(Model_Data::invalidData());
     theFeature->setDoc(myDoc);