1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0030562: Coding - TopOpeBRepBuild_Builder use of null pointer

TopOpeBRepBuild_Builder::Clear() - added NULL check.
This commit is contained in:
kgv 2019-03-12 20:22:26 +03:00 committed by apn
parent 226fce20f0
commit a7fd4b1bb0

View File

@ -194,29 +194,43 @@ void TopOpeBRepBuild_Builder::AddIntersectionEdges
//=======================================================================
void TopOpeBRepBuild_Builder::Clear()
{
if (myDataStructure.IsNull())
{
myMergedOUT.Clear();
myMergedIN.Clear();
myMergedON.Clear();
return;
}
const TopOpeBRepDS_DataStructure& BDS = myDataStructure->DS();
TopOpeBRepDS_DataMapIteratorOfDataMapOfShapeListOfShapeOn1State it;
for (it.Initialize(mySplitOUT); it.More(); it.Next()) {
for (TopOpeBRepDS_DataMapIteratorOfDataMapOfShapeListOfShapeOn1State it (mySplitOUT); it.More(); it.Next())
{
const TopoDS_Shape& e = it.Key();
if ( e.ShapeType() == TopAbs_EDGE ) {
if (e.ShapeType() == TopAbs_EDGE)
{
Standard_Boolean isse = BDS.IsSectionEdge(TopoDS::Edge(e));
if (!isse) mySplitOUT.ChangeFind(e).Clear();
}
}
for (it.Initialize(mySplitIN); it.More(); it.Next()) {
for (TopOpeBRepDS_DataMapIteratorOfDataMapOfShapeListOfShapeOn1State it (mySplitIN); it.More(); it.Next())
{
const TopoDS_Shape& e = it.Key();
if ( e.ShapeType() == TopAbs_EDGE ) {
if (e.ShapeType() == TopAbs_EDGE)
{
Standard_Boolean isse = BDS.IsSectionEdge(TopoDS::Edge(e));
if (!isse) mySplitIN.ChangeFind(e).Clear();
}
}
for (it.Initialize(mySplitON); it.More(); it.Next()) {
for (TopOpeBRepDS_DataMapIteratorOfDataMapOfShapeListOfShapeOn1State it (mySplitON); it.More(); it.Next())
{
const TopoDS_Shape& e = it.Key();
if ( e.ShapeType() == TopAbs_EDGE ) {
if (e.ShapeType() == TopAbs_EDGE)
{
Standard_Boolean isse = BDS.IsSectionEdge(TopoDS::Edge(e));
if (!isse) mySplitON.ChangeFind(e).Clear();
}
}
myMergedOUT.Clear();
myMergedIN.Clear();
myMergedON.Clear();