X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Feature.cpp;h=3c78c82d0a254403579b4068b47877724efb30d6;hb=4af82842098757e6e7f4f28e2eb744d184bb2b3e;hp=e29fff7d09f69e54a05fef982cc4cd2396f1fbde;hpb=47a805357cf60c343b91a04d3176e22b199290ea;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index e29fff7d0..3c78c82d0 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -29,7 +29,6 @@ std::shared_ptr ModelAPI_Feature::lastResult() void ModelAPI_Feature::setResult(const std::shared_ptr& theResult) { - static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID EVENT_UPD = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); @@ -47,9 +46,6 @@ void ModelAPI_Feature::setResult(const std::shared_ptr& theResu } // in any case result becomes enabled theResult->setDisabled(theResult, false); - // flush vidualisation changes - static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); - aLoop->flush(aRedispEvent); } void ModelAPI_Feature::setResult(const std::shared_ptr& theResult, @@ -65,10 +61,6 @@ void ModelAPI_Feature::setResult(const std::shared_ptr& theResu *aResIter = theResult; } theResult->setDisabled(theResult, false); - // flush visualisation changes - static Events_Loop* aLoop = Events_Loop::loop(); - static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); - aLoop->flush(aRedispEvent); } void ModelAPI_Feature::removeResult(const std::shared_ptr& theResult) @@ -154,7 +146,8 @@ void ModelAPI_Feature::erase() while (!myResults.empty()) { // remove one by one with messages std::shared_ptr aRes = *(myResults.begin()); aRes->setDisabled(aRes, true); // to avoid activation of the Part result - myResults.erase(myResults.begin()); + if (!myResults.empty()) // disabling result may erase the list (on undo of Part, issue 665) + myResults.erase(myResults.begin()); } ModelAPI_Object::erase(); }