From a61133c8c7285793ccb4fbe357cb3df5926bc979 Mon Sep 17 00:00:00 2001 From: ink Date: Thu, 5 Feb 2015 15:35:00 +0300 Subject: [PATCH] 0025780: checkshape raises an exception Standard_OutOfMemory. Improved method BRepCheck_Wire::Propagate Added test cases bugs/modalg_5/bug25780 --- src/BRepCheck/BRepCheck_Wire.cxx | 6 +++++- tests/bugs/modalg_5/bug25780 | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/bugs/modalg_5/bug25780 diff --git a/src/BRepCheck/BRepCheck_Wire.cxx b/src/BRepCheck/BRepCheck_Wire.cxx index c0f192b85c..e59fae7429 100644 --- a/src/BRepCheck/BRepCheck_Wire.cxx +++ b/src/BRepCheck/BRepCheck_Wire.cxx @@ -1551,7 +1551,8 @@ static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE, for (; itrc.More(); itrc.Next()) { const TopoDS_Shape& Edge = itrc.Value(); - mapE.Add(Edge); + if (!mapE.Contains(Edge)) + mapE.Add(Edge); TopExp_Explorer ex(Edge, TopAbs_VERTEX); for (; ex.More(); ex.Next()) @@ -1567,7 +1568,10 @@ static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE, { const TopoDS_Shape& E = itl.Value(); if (!Edge.IsSame(E) && !mapE.Contains(E)) + { + mapE.Add(E); nextEdges.Append(E); + } } } } diff --git a/tests/bugs/modalg_5/bug25780 b/tests/bugs/modalg_5/bug25780 new file mode 100644 index 0000000000..fa28c9598d --- /dev/null +++ b/tests/bugs/modalg_5/bug25780 @@ -0,0 +1,12 @@ +puts "==========" +puts "OCC25780" +puts "==========" +puts "" +###################################################### +# checkshape raises an exception Standard_OutOfMemory. +###################################################### + +restore [locate_data_file bug25780_checkshape] result +checkshape result b + +set 2dviewer 1 -- 2.39.5