X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_Update.cpp;h=659b7ca9a2764290a121241f5f7ea5da83cba458;hb=b857d9ea753bef79dbbadaeb990b54aae56e488d;hp=9e8de8d22f270a7c2c7fb2c3bf6102a4592df638;hpb=1dfcab3d738e427bea678317e167c587dfbff195;p=modules%2Fshaper.git diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 9e8de8d22..659b7ca9a 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -202,11 +202,11 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { ModelAPI_Tools::allResults(theFeature, allResults); std::list::iterator aRes = allResults.begin(); for(; aRes != allResults.end(); aRes++) { - const std::set >& aRefs = (*aRes)->data()->refsToMe(); - std::set >::const_iterator aRefIter = aRefs.cbegin(); - for(; aRefIter != aRefs.cend(); aRefIter++) { - if ((*aRefIter)->isArgument()) { - FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRefIter)->owner()); + const std::set >& aResRefs = (*aRes)->data()->refsToMe(); + std::set >::const_iterator aRIter = aResRefs.cbegin(); + for(; aRIter != aResRefs.cend(); aRIter++) { + if ((*aRIter)->isArgument()) { + FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRIter)->owner()); if (aReferenced.get()) { addModified(aReferenced, theFeature); } @@ -360,7 +360,7 @@ void Model_Update::processEvent(const std::shared_ptr& theMessag for(; aRefIter != aRefs.cend(); aRefIter++) { if (!(*aRefIter)->owner()->data()->isValid()) continue; - FeaturePtr anUpdated = std::dynamic_pointer_cast((*aRefIter)->owner()); + anUpdated = std::dynamic_pointer_cast((*aRefIter)->owner()); if (anUpdated.get()) { if (addModified(anUpdated, aReason)) aSomeModified = true; @@ -913,6 +913,8 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { std::dynamic_pointer_cast(*aRefsIter); // #19071 : avoid sending of update event in cycle bool aWasBlocked = theFeature->data()->blockSendAttributeUpdated(true); + // list to keep the shared pointers while update is blocked (in messages raw poiters are used) + std::list anAttrList; for(int a = aSel->size() - 1; a >= 0; a--) { std::shared_ptr aSelAttr = std::dynamic_pointer_cast(aSel->value(a)); @@ -921,6 +923,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { // update argument only if the referenced object is ready to use if (aContext.get() && !aContext->isDisabled()) { if (isReason(theFeature, aContext)) { + anAttrList.push_back(aSelAttr); if (!aSelAttr->update()) { bool isObligatory = !aFactory->isNotObligatory( theFeature->getKind(), theFeature->data()->id(aSel)) &&