From: mpv Date: Mon, 10 Jul 2017 11:49:06 +0000 (+0300) Subject: Fix for the issue #2217: catch exceptions on update of attributes. X-Git-Tag: V_2.7.2RC~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa1341634c9cf383723a614acce0f227f034302c;p=modules%2Fshaper.git Fix for the issue #2217: catch exceptions on update of attributes. --- diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 7bfa1c237..867614ca3 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -307,7 +307,14 @@ void Model_Data::sendAttributeUpdated(ModelAPI_Attribute* theAttr) if (theAttr->isArgument()) { if (mySendAttributeUpdated) { if (myObject) { - myObject->attributeChanged(theAttr->id()); + try { + myObject->attributeChanged(theAttr->id()); + } catch(...) { + if (owner().get() && owner()->data().get() && owner()->data()->isValid()) { + Events_InfoMessage("Model_Data", + "%1 has failed during the update").arg(owner()->data()->name()).send(); + } + } static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent); } @@ -339,7 +346,14 @@ bool Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSe myWasChangedButBlocked.clear(); std::list::iterator aChangedIter = aWasChangedButBlocked.begin(); for(; aChangedIter != aWasChangedButBlocked.end(); aChangedIter++) { - myObject->attributeChanged((*aChangedIter)->id()); + try { + myObject->attributeChanged((*aChangedIter)->id()); + } catch(...) { + if (owner().get() && owner()->data().get() && owner()->data()->isValid()) { + Events_InfoMessage("Model_Data", + "%1 has failed during the update").arg(owner()->data()->name()).send(); + } + } } static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent);