Backport 93466fa1: Fix crash when adding 3D Models via Python

This commit is contained in:
Jan Mrázek 2020-12-28 23:22:16 +01:00
parent 591a07d2d9
commit 540fb91d34
No known key found for this signature in database
GPG Key ID: A3E71126F180EB6F
2 changed files with 5 additions and 3 deletions

View File

@ -783,8 +783,6 @@ void MODULE::Add3DModel( MODULE_3D_SETTINGS* a3DModel )
if( !a3DModel->m_Filename.empty() )
m_3D_Drawings.push_back( *a3DModel );
delete a3DModel;
}

View File

@ -2182,7 +2182,11 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
break;
case T_model:
module->Add3DModel( parse3DModel() );
{
MODULE_3D_SETTINGS* model = parse3DModel();
module->Add3DModel( model );
delete model;
}
break;
default: