1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0031320: TObj - method TObj_Object::GetFatherObject() is not protected against deleted object

This commit is contained in:
mpv
2020-08-31 18:24:59 +03:00
committed by bugmaster
parent f5e758d239
commit 17a5b56767
4 changed files with 85 additions and 1 deletions

View File

@@ -615,8 +615,12 @@ Standard_Boolean TObj_Object::GetObj(const TDF_Label& theLabel,
Handle(TObj_Object) TObj_Object::GetFatherObject
(const Handle(Standard_Type)& theType) const
{
Handle(TObj_Object) aFather, aSon(this);
Handle(TObj_Object) aFather;
if (myLabel.IsNull())
return aFather;
Handle(TObj_Object) aSon(this);
while ( aSon->GetObj( aSon->GetLabel().Father(), aFather, Standard_True ) )
{
if (theType.IsNull() || aFather->IsKind( theType ))