]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix couple of crashes in SketchSolver plugin
authorazv <azv@opencascade.com>
Tue, 12 Jul 2016 07:20:24 +0000 (10:20 +0300)
committerazv <azv@opencascade.com>
Tue, 12 Jul 2016 07:20:24 +0000 (10:20 +0300)
src/SketchSolver/SketchSolver_ConstraintMulti.cpp
src/SketchSolver/SketchSolver_Manager.cpp

index 952fecafde345747888747c954693afe9a395e08..f89f314211543a8131b0aefdc35dd4537c85465a 100644 (file)
@@ -43,7 +43,8 @@ void SketchSolver_ConstraintMulti::getEntities(std::list<EntityWrapperPtr>& theE
     if (!aFeature)
       continue;
 
-    myStorage->update(aFeature);
+    if (!myStorage->update(aFeature)) // the entity is not created, so it is a copy in "multi" constraint, force its creation
+      myStorage->update(aFeature, myGroupID, true);
     theEntities.push_back(myStorage->entity(aFeature));
     myFeatures.insert(aFeature);
     for (int i = 0; i < myNumberOfCopies && anObjIt != anObjectList.end(); ++i, ++anObjIt) {
index c83f544f2f45d1a86d818a76e680073a8c321354..4748424f865e704108d37e2005a6dce2557fda3c 100644 (file)
@@ -526,7 +526,7 @@ static void collectPointsAndCopies(FeaturePtr theConstraint, std::list<std::set<
       for (; anIt != anAttrList.end(); ++anIt) {
         aPoints.clear();
         aCopyIt = anObjIt;
-        for (int i = 0; i < aNbCopies; ++i, ++aCopyIt) {
+        for (int i = 0; i < aNbCopies && aCopyIt != aFullList.end(); ++i, ++aCopyIt) {
           FeaturePtr aFeature = ModelAPI_Feature::feature(*aCopyIt);
           aPoints.insert(aFeature->attribute(*anIt));
         }