BRepBuilderAPI_MakeWire crash

I'm using MakeWire after building a TopoDS_Edge from a Geom_Curve.
It always crashes (memory problem).

I took a look at the TopoloyBuilding sample (mfc).
The CTopologyBuildingDoc::OnGeometrie() method is quite similar as mine.

If i add the last two lines, i obtain the same crash.

// OnGeometrie
TopLoc_Location location;
Standard_Real first, last;
Handle (Geom_Curve) aCurve = BRep_Tool::Curve(anEdge,location,first,last);

TopoDS_Edge anEdgeDS = BRepBuilderAPI_MakeEdge(aCurve);

// If i had these 2 lines :: crash
BRepBuilderAPI_MakeWire mw;
mw.Add(anEdgeDS);

I also tried :
BRepLib::BuildCurve3d(...);
ShapeAnalysis_Edge edgeFix

...without success.
Someone has an idea ?
Thanks for help.
Francois.

francois's picture

bug found : no limits given to the edge.

TopoDS_Edge anEdgeDS = BRepBuilderAPI_MakeEdge(aCurve, first, last);

works fine.