Remove group reference when exporting individual footprints

(Cherry-picked from d923b871d7)
This commit is contained in:
Ian McInerney 2023-06-28 21:56:46 +01:00
parent b4b49a4296
commit 7bc0f8731f
2 changed files with 5 additions and 1 deletions

View File

@ -763,6 +763,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

@ -2675,8 +2675,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,