0022832: EDF GEOM: Bug with curve construction

Additional commit: fix memory leak plus small redesign
This commit is contained in:
vsr 2014-12-18 18:11:55 +03:00
parent 8170166255
commit 3af8489874

View File

@ -366,14 +366,17 @@ bool GEOM_Object_i::IsShape()
bool GEOM_Object_i::IsSame(GEOM::GEOM_BaseObject_ptr other) bool GEOM_Object_i::IsSame(GEOM::GEOM_BaseObject_ptr other)
{ {
GEOM::GEOM_Object_ptr shapePtr = GEOM::GEOM_Object::_narrow( other ); bool result = false;
if ( CORBA::is_nil( shapePtr ) )
return false; GEOM::GEOM_Object_var shapePtr = GEOM::GEOM_Object::_narrow( other );
TopoDS_Shape thisShape = _impl->GetValue(); if ( !CORBA::is_nil( shapePtr ) ) {
TopoDS_Shape otherShape; Handle(GEOM_Object) otherObject = Handle(GEOM_Object)::DownCast
Handle(GEOM_Object) otherObject = Handle(GEOM_Object)::DownCast ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), shapePtr->GetEntry(), false ));
( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), shapePtr->GetEntry(), false )); if ( !otherObject.IsNull() ) {
if ( !otherObject.IsNull() ) TopoDS_Shape thisShape = _impl->GetValue();
otherShape = otherObject->GetValue(); TopoDS_Shape otherShape = otherObject->GetValue();
return thisShape.IsSame( otherShape ); result = !thisShape.IsNull() && !otherShape.IsNull() && thisShape.IsSame( otherShape );
}
}
return result;
} }