From 32890be4203666e4fc8881eb4624239f386320d6 Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 19 Oct 2021 16:21:26 +0300 Subject: [PATCH] [bos #26531] [CEA] Shaper tests fail with SEGFAULT --- src/Selector/Selector_Modify.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Selector/Selector_Modify.cpp b/src/Selector/Selector_Modify.cpp index 5bd76c799..ad84e825a 100644 --- a/src/Selector/Selector_Modify.cpp +++ b/src/Selector/Selector_Modify.cpp @@ -152,17 +152,18 @@ bool Selector_Modify::select(NCollection_List& theMo const TopoDS_Shape theContext, const TopoDS_Shape theValue) { if (theModifList.Extent() > 1) { // searching for the best modification result: by context + bool isFound = false; Handle(TNaming_NamedShape) aCandidate; NCollection_List::Iterator aModIter(theModifList); - for (; !theModifList.IsEmpty() && aModIter.More(); aModIter.Next()) { + for (; aModIter.More() && !isFound; aModIter.Next()) { aCandidate = aModIter.Value(); TDF_Label aFatherLab = aCandidate->Label().Father(); Handle(TNaming_NamedShape) aFatherNS; if (aFatherLab.FindAttribute(TNaming_NamedShape::GetID(), aFatherNS)) { - for (TNaming_Iterator anIter(aFatherNS); anIter.More(); anIter.Next()) { + for (TNaming_Iterator anIter(aFatherNS); + anIter.More() && !isFound; anIter.Next()) { if (theContext.IsSame(anIter.NewShape())) { // found the best modification - theModifList.Clear(); - break; + isFound = true; } } } -- 2.39.2