Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #3086: Avoid crash when FeatureInfo is null.
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_ITreeNode.h
diff --git
a/src/ModuleBase/ModuleBase_ITreeNode.h
b/src/ModuleBase/ModuleBase_ITreeNode.h
index cef49758a23bc02fe4bc26c59943d222f697c483..630251a560c529459bbd4b420e957a225b7181c2 100644
(file)
--- a/
src/ModuleBase/ModuleBase_ITreeNode.h
+++ b/
src/ModuleBase/ModuleBase_ITreeNode.h
@@
-1,4
+1,4
@@
-// Copyright (C) 2014-201
7
CEA/DEN, EDF R&D
+// Copyright (C) 2014-201
9
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
//
// 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
//
// 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef ModuleBase_ITreeNode_H
//
#ifndef ModuleBase_ITreeNode_H
@@
-185,9
+184,14
@@
protected:
int aIdx;
int aCount = 0;
int aSize = myChildren.size();
int aIdx;
int aCount = 0;
int aSize = myChildren.size();
+ int aMaxCount = aSize * aSize;
int aShift = 0;
while (i < aSize) {
aCount++;
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()) {
aNode = myChildren.at(i);
aObject = aNode->object();
if (aObject.get()) {
@@
-202,9
+206,6
@@
protected:
else
aShift++;
i++;
else
aShift++;
i++;
- // To avoid unlimited cycling
- if (aCount > aSize * aSize)
- break;
}
}
}
}
}
}