X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OverconstraintListener.cpp;h=b8924b8a27bc59237d8b7a931efaa3dfede4de3a;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=5db78193f6a92f367f127386aa3415f9668404ea;hpb=cdbbde4803e9c320204d537d22af4ac7ef024962;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 5db78193f..b8924b8a2 100644 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2021 CEA/DEN, EDF R&D +// Copyright (C) 2014-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -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())