From: azv Date: Fri, 15 Dec 2017 11:36:42 +0000 (+0300) Subject: Issue #2373: Fatal error when macros box after folder X-Git-Tag: V_2.10.0RC~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f0cfc282531e9a07769b252fff20ca4c89e7f408;p=modules%2Fshaper.git Issue #2373: Fatal error when macros box after folder Correct deleting feature which is placed in folder --- diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 85a9f6dc2..6f5c45a21 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -307,6 +307,8 @@ void Model_Objects::removeFeature(FeaturePtr theFeature) aComposite->removeFeature(theFeature); } } + // remove feature from folder + removeFromFolder(std::list(1, theFeature)); // this must be before erase since theFeature erasing removes all information about // the feature results and groups of results // To reproduce: create sketch, extrusion, remove sketch => constructions tree is not updated diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index 161220521..830a482fe 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -150,7 +150,7 @@ static bool hasReference(std::shared_ptr theFeature, for (std::set::const_iterator aRefIt = aRefs.begin(); aRefIt != aRefs.end(); ++aRefIt) { FeaturePtr anOwner = ModelAPI_Feature::feature((*aRefIt)->owner()); - if (anOwner->getKind() == theFeatureKind) + if (anOwner && anOwner->getKind() == theFeatureKind) return true; } return false;