From: mpv Date: Fri, 2 Oct 2020 12:20:25 +0000 (+0300) Subject: FIx for EDF 22041 - Salome freezes when updating data X-Git-Tag: V9_6_0a2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b06f1e4f71ff65530be332bf846a23a0006c3353;p=modules%2Fshaper.git FIx for EDF 22041 - Salome freezes when updating data --- diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index a0dfe058a..9127a9915 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -190,13 +190,14 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { #endif } // clear processed and fill modified recursively + std::set aRefSet; const std::set >& aRefs = theFeature->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()); if (aReferenced.get()) { - addModified(aReferenced, theFeature); + aRefSet.insert(aReferenced); } } } @@ -211,19 +212,21 @@ bool Model_Update::addModified(FeaturePtr theFeature, FeaturePtr theReason) { if ((*aRIter)->isArgument()) { FeaturePtr aReferenced = std::dynamic_pointer_cast((*aRIter)->owner()); if (aReferenced.get()) { - addModified(aReferenced, theFeature); + aRefSet.insert(aReferenced); } } } } - // also add part feature that contains this feature to the modified if (theFeature->document()->kind() != "PartSet") { FeaturePtr aPart = ModelAPI_Tools::findPartFeature( ModelAPI_Session::get()->moduleDocument(), theFeature->document()); if (aPart.get()) - addModified(aPart, theFeature); + aRefSet.insert(aPart); } + for(std::set::iterator aRef = aRefSet.begin(); aRef != aRefSet.end(); aRef++) + addModified(*aRef, theFeature); + return true; }