Don't leave deleted items in a group.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15797
(cherry picked from commit 14d5a404b2
)
This commit is contained in:
parent
121394c0c0
commit
e85eec2e6b
|
@ -38,6 +38,7 @@
|
||||||
#include <tools/board_editor_control.h>
|
#include <tools/board_editor_control.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#include <footprint.h>
|
#include <footprint.h>
|
||||||
|
#include <pcb_group.h>
|
||||||
#include <board_commit.h>
|
#include <board_commit.h>
|
||||||
#include <footprint_edit_frame.h>
|
#include <footprint_edit_frame.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
@ -764,7 +765,8 @@ void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxStr
|
||||||
pi->FootprintSave( libPath, fpCopy );
|
pi->FootprintSave( libPath, fpCopy );
|
||||||
|
|
||||||
// Remove reference to the group before deleting
|
// Remove reference to the group before deleting
|
||||||
fpCopy->SetParentGroup( nullptr );
|
if( PCB_GROUP* parentGroup = fpCopy->GetParentGroup() )
|
||||||
|
parentGroup->RemoveItem( fpCopy );
|
||||||
|
|
||||||
delete fpCopy;
|
delete fpCopy;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue