Remove group reference when exporting individual footprints

This commit is contained in:
Ian McInerney 2023-06-28 21:56:46 +01:00
parent 4cb993d872
commit d923b871d7
2 changed files with 5 additions and 1 deletions

View File

@ -767,6 +767,9 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
resetReference( fpCopy );
pi->FootprintSave( libPath, fpCopy );
// Remove reference to the group before deleting
fpCopy->SetParentGroup( nullptr );
delete fpCopy;
}
}

View File

@ -2530,8 +2530,9 @@ void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* a
footprint->Flip( footprint->GetPosition(), false );
}
// Detach it from the board
// Detach it from the board and its group
footprint->SetParent( nullptr );
footprint->SetParentGroup( nullptr );
wxLogTrace( traceKicadPcbPlugin, wxT( "Creating s-expr footprint file '%s'." ), fullPath );
footprints.insert( footprintName,