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_0rc1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=683b01a99a9b434898cf99351aa5d9d212f8c8c9;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 db2355e5f..94c06476b 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())