Salome HOME
projects
/
modules
/
shaper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9549a26
)
Issue #2727: Avoid unlimited loop in sorting
author
vsv
<vsv@opencascade.com>
Mon, 29 Oct 2018 12:47:25 +0000
(15:47 +0300)
committer
mpv
<mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000
(11:45 +0300)
src/ModuleBase/ModuleBase_ITreeNode.h
patch
|
blob
|
history
diff --git
a/src/ModuleBase/ModuleBase_ITreeNode.h
b/src/ModuleBase/ModuleBase_ITreeNode.h
index cef49758a23bc02fe4bc26c59943d222f697c483..33b8d8a6450dcf922a08a571b33d391971a36f77 100644
(file)
--- a/
src/ModuleBase/ModuleBase_ITreeNode.h
+++ b/
src/ModuleBase/ModuleBase_ITreeNode.h
@@
-185,9
+185,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
+207,6
@@
protected:
else
aShift++;
i++;
- // To avoid unlimited cycling
- if (aCount > aSize * aSize)
- break;
}
}
}