Fix crash when adding 3D Models via Python
This commit is contained in:
parent
a761d42c12
commit
93466fa165
|
@ -968,13 +968,11 @@ unsigned FOOTPRINT::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const
|
|||
|
||||
void FOOTPRINT::Add3DModel( FP_3DMODEL* a3DModel )
|
||||
{
|
||||
if( NULL == a3DModel )
|
||||
if( nullptr == a3DModel )
|
||||
return;
|
||||
|
||||
if( !a3DModel->m_Filename.empty() )
|
||||
m_3D_Drawings.push_back( *a3DModel );
|
||||
|
||||
delete a3DModel;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3117,7 +3117,11 @@ FOOTPRINT* PCB_PARSER::parseFOOTPRINT_unchecked( wxArrayString* aInitialComments
|
|||
break;
|
||||
|
||||
case T_model:
|
||||
footprint->Add3DModel( parse3DModel() );
|
||||
{
|
||||
FP_3DMODEL* model = parse3DModel();
|
||||
footprint->Add3DModel( model );
|
||||
delete model;
|
||||
}
|
||||
break;
|
||||
|
||||
case T_zone:
|
||||
|
|
Loading…
Reference in New Issue