From 9f5fac5b756009fbf61d49388bc95d10362b1b92 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 17 May 2018 14:41:57 +0300 Subject: [PATCH] Issue #2468: Crash when sketching circles successively on a repetition --- src/SketchPlugin/SketchPlugin_MacroArc.cpp | 13 +++++-------- src/SketchPlugin/SketchPlugin_MacroCircle.cpp | 12 +++++------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.cpp b/src/SketchPlugin/SketchPlugin_MacroArc.cpp index 8016c3353..b6a09bde6 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroArc.cpp @@ -436,14 +436,11 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptrsetAttr(anAttribute); } else if (anObject.get()) { - // if presentation of previous reentrant macro arc is used, the object is invalid, - // we should use result of previous feature of the message(Arc) - if (!anObject->data()->isValid()) { - FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature(); - if (aCreatedFeature.get()) - anObject = aCreatedFeature->lastResult(); - } - aRefAttr->setObject(anObject); + // if attribute is NULL, only object is defined, it should be processed outside + // the feature because it might be an external feature, that will be + // removed/created again after restart operation + // #2468 - Crash when sketching circles successively on a repetition + aFilledAttributeName = ARC_TYPE(); } } } diff --git a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp index b584a004e..3b8049b57 100644 --- a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp @@ -168,13 +168,11 @@ std::string SketchPlugin_MacroCircle::processEvent( aRefAttr->setAttr(anAttribute); } else if (anObject.get()) { - // if presentation of previous reentrant macro arc is used, the object is invalid, - // we should use result of previous feature of the message(Arc) - if (!anObject->data()->isValid()) { - FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature(); - anObject = aCreatedFeature->lastResult(); - } - aRefAttr->setObject(anObject); + // if attribute is NULL, only object is defined, it should be processed outside + // the feature because it might be an external feature, that will be + // removed/created again after restart operation + // #2468 - Crash when sketching circles successively on a repetition + aFilledAttributeName = CIRCLE_TYPE(); } } } -- 2.39.2