mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026385: Fix to prevent BRepMesh from possible crash due to pointer to local variable stored inside Extrema_LocateExtPC
Made the BRepAdaptor_Curve a member of BRepMesh_EdgeParameterProvider to ensure that it is created before and destroyed after the Extrema_LocateExtPC that uses it.
This commit is contained in:
parent
8948e7784a
commit
51aed73084
@ -32,7 +32,8 @@ BRepMesh_EdgeParameterProvider::BRepMesh_EdgeParameterProvider(
|
|||||||
const Handle(TColStd_HArray1OfReal)& theParameters)
|
const Handle(TColStd_HArray1OfReal)& theParameters)
|
||||||
: myParameters(theParameters),
|
: myParameters(theParameters),
|
||||||
myIsSameParam(BRep_Tool::SameParameter(theEdge)),
|
myIsSameParam(BRep_Tool::SameParameter(theEdge)),
|
||||||
myScale(1.)
|
myScale(1.),
|
||||||
|
myCurveAdaptor(theEdge, theFace)
|
||||||
{
|
{
|
||||||
if (myIsSameParam)
|
if (myIsSameParam)
|
||||||
return;
|
return;
|
||||||
@ -58,9 +59,8 @@ BRepMesh_EdgeParameterProvider::BRepMesh_EdgeParameterProvider(
|
|||||||
(aOldLastParam - myOldFirstParam);
|
(aOldLastParam - myOldFirstParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
BRepAdaptor_Curve aCOnS(theEdge, theFace);
|
myProjector.Initialize(myCurveAdaptor, myCurveAdaptor.FirstParameter(),
|
||||||
myProjector.Initialize(aCOnS, aCOnS.FirstParameter(),
|
myCurveAdaptor.LastParameter(), Precision::PConfusion());
|
||||||
aCOnS.LastParameter(), Precision::PConfusion());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include <Standard_DefineAlloc.hxx>
|
#include <Standard_DefineAlloc.hxx>
|
||||||
#include <Extrema_LocateExtPC.hxx>
|
#include <Extrema_LocateExtPC.hxx>
|
||||||
#include <TColStd_HArray1OfReal.hxx>
|
#include <TColStd_HArray1OfReal.hxx>
|
||||||
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
|
|
||||||
class gp_Pnt;
|
class gp_Pnt;
|
||||||
class TopoDS_Edge;
|
class TopoDS_Edge;
|
||||||
@ -63,6 +64,7 @@ private:
|
|||||||
Standard_Real myCurParam;
|
Standard_Real myCurParam;
|
||||||
Standard_Real myFoundParam;
|
Standard_Real myFoundParam;
|
||||||
|
|
||||||
|
BRepAdaptor_Curve myCurveAdaptor;
|
||||||
Extrema_LocateExtPC myProjector;
|
Extrema_LocateExtPC myProjector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user