From: jfa Date: Wed, 11 May 2022 14:44:06 +0000 (+0300) Subject: [bos #29933] [CEA 29931] Redundant constraint in SHAPER SIGSEGV X-Git-Tag: V9_9_1b1~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=026f4997e7531acff5d6677877d4e948088c46ac;p=modules%2Fshaper.git [bos #29933] [CEA 29931] Redundant constraint in SHAPER SIGSEGV --- diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 5db78193f..74b1bde5a 100644 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -238,12 +238,11 @@ void PartSet_OverconstraintListener::processEvent(const std::shared_ptrconstraints(); - std::set::const_iterator - anIt = myObjectsToRemove.begin(), aLast = myObjectsToRemove.end(); + std::set::const_iterator anIt = myObjectsToRemove.begin(); PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); - for (; anIt != aLast; anIt++) + for (; anIt != myObjectsToRemove.end(); ) { ObjectPtr anObject = *anIt; FeaturePtr aFeature = std::dynamic_pointer_cast(anObject); @@ -251,7 +250,9 @@ void PartSet_OverconstraintListener::processEvent(const std::shared_ptrsketchReentranceMgr()->isLastAutoConstraint(*anIt)) - myObjectsToRemove.erase(*anIt); + anIt = myObjectsToRemove.erase(anIt); + else + anIt++; } if (myObjectsToRemove.empty())