{
if(!theObject)
return;
- if (!myIsInitialized || value() != theObject) {
+ ObjectPtr aValue = value();
+ if (!myIsInitialized || aValue != theObject) {
+ REMOVE_BACK_REF(aValue);
+
std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(
- theObject->data());
+ theObject->data());
TDF_Label anObjLab = aData->label().Father(); // object label
if (owner()->document() == theObject->document()) { // same document, use reference attribute
}
// do it before the transaction finish to make just created/removed objects know dependencies
// and reference from composite feature is removed automatically
- FeaturePtr anOwnerFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
- if (anOwnerFeature.get()) {
- aData->addBackReference(anOwnerFeature, id());
- }
+ ADD_BACK_REF(theObject);
owner()->data()->sendAttributeUpdated(this);
}