From 26bfcad40a336722644bfb9643fc490d5ef711d9 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 14 Oct 2011 15:09:47 +0000 Subject: [PATCH] 0019957: EDF 785 SMESH: Convert Quadratic and Group on GEOM Avoid endless recursing in FindCoincidentNodes() function (causing crash) --- src/SMESHUtils/SMESH_OctreeNode.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SMESHUtils/SMESH_OctreeNode.cxx b/src/SMESHUtils/SMESH_OctreeNode.cxx index f735011e6..ddaac892b 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.cxx +++ b/src/SMESHUtils/SMESH_OctreeNode.cxx @@ -249,7 +249,9 @@ void SMESH_OctreeNode::FindCoincidentNodes (TIDSortedNodeSet& theSetOfNodes, const int maxLevel, const int maxNbNodes) { - SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel, maxNbNodes, theTolerance); + // VSR 14/10/2011: limit max number of the levels in order to avoid endless recursing + const int MAX_LEVEL = 10; + SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel < 0 ? MAX_LEVEL : maxLevel, maxNbNodes, theTolerance); theOctreeNode.FindCoincidentNodes (&theSetOfNodes, theTolerance, theGroupsOfNodes); } -- 2.39.2