]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Temporary workaround for crash fix (some unknown memory problem)
authormpv <mikhail.ponikarov@opencascade.com>
Wed, 30 Jul 2014 14:47:52 +0000 (18:47 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Wed, 30 Jul 2014 14:47:52 +0000 (18:47 +0400)
src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp

index c5c8588d401e552013b22a2fd761afdb11da84f7..cba0974a5f18101631d2027e54ba359119fcc153 100644 (file)
@@ -157,6 +157,8 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
   gp_Dir aNextDir;
   while (aMapVE.Extent() > 0)
   {
+    if (aCurVertex.IsNull())
+      return;
     findNextVertex(aCurVertex, aMapVE, aCurDir, aCurNorm, aNextVertex, aBindingEdge, aNextDir);
     aCurNorm = aNorm;
 
@@ -210,7 +212,7 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
       if (!aPatch.IsNull())
       {
         boost::shared_ptr<GeomAPI_Shape> aFace(new GeomAPI_Shape);
-        aFace->setImpl(new TopoDS_Shape(aPatch));
+        aFace->setImpl(new TopoDS_Face(aPatch));
         theResultFaces.push_back(aFace);
       }
       // push the edges used in the loop to the map
@@ -344,6 +346,8 @@ void GeomAlgoAPI_SketchBuilder::fixIntersections(
     for (++anIter2; anIter2 != theFaces.end(); anIter2++)
     {
       const TopoDS_Face& aF1 = (*anIter1)->impl<TopoDS_Face>();
+      if (aF1.ShapeType() != TopAbs_FACE) // TODO: MPV - this workaround must be fixed later by AZV, now it just removes crash
+        continue;
       TopExp_Explorer aVert2((*anIter2)->impl<TopoDS_Shape>(), TopAbs_VERTEX);
       for ( ; aVert2.More(); aVert2.Next())
       {