mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56: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)
|
||||
: myParameters(theParameters),
|
||||
myIsSameParam(BRep_Tool::SameParameter(theEdge)),
|
||||
myScale(1.)
|
||||
myScale(1.),
|
||||
myCurveAdaptor(theEdge, theFace)
|
||||
{
|
||||
if (myIsSameParam)
|
||||
return;
|
||||
@ -58,9 +59,8 @@ BRepMesh_EdgeParameterProvider::BRepMesh_EdgeParameterProvider(
|
||||
(aOldLastParam - myOldFirstParam);
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve aCOnS(theEdge, theFace);
|
||||
myProjector.Initialize(aCOnS, aCOnS.FirstParameter(),
|
||||
aCOnS.LastParameter(), Precision::PConfusion());
|
||||
myProjector.Initialize(myCurveAdaptor, myCurveAdaptor.FirstParameter(),
|
||||
myCurveAdaptor.LastParameter(), Precision::PConfusion());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Extrema_LocateExtPC.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
|
||||
class gp_Pnt;
|
||||
class TopoDS_Edge;
|
||||
@ -63,6 +64,7 @@ private:
|
||||
Standard_Real myCurParam;
|
||||
Standard_Real myFoundParam;
|
||||
|
||||
BRepAdaptor_Curve myCurveAdaptor;
|
||||
Extrema_LocateExtPC myProjector;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user