]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for unit tests
authormpv <mpv@opencascade.com>
Mon, 11 Apr 2016 13:38:48 +0000 (16:38 +0300)
committermpv <mpv@opencascade.com>
Mon, 11 Apr 2016 13:38:48 +0000 (16:38 +0300)
src/Model/Model_Data.cpp
src/Model/Model_Objects.cpp

index c907ea63fc9b628d55cee9e920ccf9e8240be6fd..f292ccc75a5272dc01d417f7f7eb08b1a7c6ab4a 100644 (file)
@@ -536,7 +536,13 @@ void Model_Data::referencesToObjects(
     } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { // reference to attribute or object
       std::shared_ptr<ModelAPI_AttributeRefAttr> aRef = std::dynamic_pointer_cast<
           ModelAPI_AttributeRefAttr>(anAttr->second);
-      aReferenced.push_back(aRef->isObject() ? aRef->object() : aRef->attr()->owner());
+      if (aRef->isObject()) {
+        aReferenced.push_back(aRef->object());
+      } else {
+        AttributePtr anAttr = aRef->attr();
+        if (anAttr.get())
+          aReferenced.push_back(anAttr->owner());
+      }
     } else if (aType == ModelAPI_AttributeRefList::typeId()) { // list of references
       aReferenced = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(anAttr->second)->list();
     } else if (aType == ModelAPI_AttributeSelection::typeId()) { // selection attribute
index 11365789dc8b98dd6cad5a020905b69b4bd552d6..d421d2161ecc21ac8a19a55711108694b87079cc 100644 (file)
@@ -691,7 +691,9 @@ void Model_Objects::synchronizeFeatures(
         // redisplay also removed feature (used for sketch and AISObject)
         ModelAPI_EventCreator::get()->sendUpdated(aFeature, aRedispEvent);
         updateHistory(aFeature);
-        aFeature->erase();
+        // don't call this because it will ask the internal attributes
+        //aFeature->erase();
+
         // unbind after the "erase" call: on abort sketch is removes sub-objects that corrupts aFIter
         myFeatures.UnBind(aFIter.Key());
         // reinitialize iterator because unbind may corrupt the previous order in the map