Ensure we close the occt document at the end of loading
(cherry picked from commit d211ef1ea3
)
This commit is contained in:
parent
7d5c1d7b5c
commit
aa5b6c70a7
|
@ -671,24 +671,34 @@ SCENEGRAPH* LoadModel( char const* filename )
|
||||||
data.renderBoth = true;
|
data.renderBoth = true;
|
||||||
|
|
||||||
if( !readIGES( data.m_doc, filename ) )
|
if( !readIGES( data.m_doc, filename ) )
|
||||||
|
{
|
||||||
|
m_app->Close( data.m_doc );
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FMT_STEP:
|
case FMT_STEP:
|
||||||
if( !readSTEP( data.m_doc, filename ) )
|
if( !readSTEP( data.m_doc, filename ) )
|
||||||
|
{
|
||||||
|
m_app->Close( data.m_doc );
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FMT_STPZ:
|
case FMT_STPZ:
|
||||||
if( !readSTEPZ( data.m_doc, filename ) )
|
if( !readSTEPZ( data.m_doc, filename ) )
|
||||||
|
{
|
||||||
|
m_app->Close( data.m_doc );
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
m_app->Close( data.m_doc );
|
||||||
return nullptr;
|
return nullptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -724,7 +734,10 @@ SCENEGRAPH* LoadModel( char const* filename )
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !ret )
|
if( !ret )
|
||||||
|
{
|
||||||
|
m_app->Close( data.m_doc );
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
SCENEGRAPH* scene = (SCENEGRAPH*)data.scene;
|
SCENEGRAPH* scene = (SCENEGRAPH*)data.scene;
|
||||||
|
|
||||||
|
@ -749,6 +762,8 @@ SCENEGRAPH* LoadModel( char const* filename )
|
||||||
// set to NULL to prevent automatic destruction of the scene data
|
// set to NULL to prevent automatic destruction of the scene data
|
||||||
data.scene = nullptr;
|
data.scene = nullptr;
|
||||||
|
|
||||||
|
m_app->Close( data.m_doc );
|
||||||
|
|
||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue