Fixed a memleak in PCB_EDIT_FRAME::LoadFootprints()

This commit is contained in:
Maciej Suminski 2017-10-30 14:19:42 +01:00
parent 3a8b4a2fb7
commit e8e10c9245
1 changed files with 4 additions and 3 deletions

View File

@ -284,9 +284,10 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
if( !aNetlist.GetReplaceFootprints() ) if( !aNetlist.GetReplaceFootprints() )
footprintMisMatch = false; footprintMisMatch = false;
bool loadFootprint = (fpOnBoard == NULL) || footprintMisMatch; if( fpOnBoard && !footprintMisMatch ) // nothing else to do here
continue;
if( loadFootprint && (component->GetFPID() != lastFPID) ) if( component->GetFPID() != lastFPID )
{ {
module = NULL; module = NULL;
@ -340,7 +341,7 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
module = new MODULE( *module ); module = new MODULE( *module );
} }
if( loadFootprint && module != NULL ) if( module )
component->SetModule( module ); component->SetModule( module );
} }
} }