Salome HOME
Issue #2468: Crash when sketching circles successively on a repetition Port_SALOME_8.5.0
authornds <nds@opencascade.com>
Thu, 17 May 2018 11:41:57 +0000 (14:41 +0300)
committernds <nds@opencascade.com>
Thu, 17 May 2018 11:41:57 +0000 (14:41 +0300)
src/SketchPlugin/SketchPlugin_MacroArc.cpp
src/SketchPlugin/SketchPlugin_MacroCircle.cpp

index 8016c335395c701a1275e50b496c62415f0f5267..b6a09bde6af0dcd820b36d2ff88b344ef7856607 100644 (file)
@@ -436,14 +436,11 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr<Events_Mes
               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();
-                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();
             }
           }
         }
index b584a004eb5afae582a801a631b3771df3973b30..3b8049b5777f16462b2aff6f7c81c063a8ff8ae9 100644 (file)
@@ -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();
         }
       }
     }