X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ITreeNode.h;h=630251a560c529459bbd4b420e957a225b7181c2;hb=c6745a6b1ad00c0285fab5aeac2cb0d57afef5cc;hp=cef49758a23bc02fe4bc26c59943d222f697c483;hpb=deeef3297f0914337a4d78c14b5b4dd7179f003c;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ITreeNode.h b/src/ModuleBase/ModuleBase_ITreeNode.h index cef49758a..630251a56 100644 --- a/src/ModuleBase/ModuleBase_ITreeNode.h +++ b/src/ModuleBase/ModuleBase_ITreeNode.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef ModuleBase_ITreeNode_H @@ -185,9 +184,14 @@ protected: int aIdx; int aCount = 0; int aSize = myChildren.size(); + int aMaxCount = aSize * aSize; int aShift = 0; while (i < aSize) { aCount++; + // To avoid unlimited cycling + if (aCount > aMaxCount) + break; + aNode = myChildren.at(i); aObject = aNode->object(); if (aObject.get()) { @@ -202,9 +206,6 @@ protected: else aShift++; i++; - // To avoid unlimited cycling - if (aCount > aSize * aSize) - break; } } }