Specctra: remove grouped tracks from group before cleaning up

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14763
This commit is contained in:
Jon Evans 2023-05-17 23:03:06 -04:00
parent 3cd89eeffb
commit 27afd22bbf
1 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pcb_group.h>
#include <pcb_track.h>
#include <connectivity/connectivity_data.h>
#include <view/view.h>
@ -356,9 +357,16 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard )
aBoard->Tracks().pop_back();
if( track->IsLocked() )
{
locked.push_back( track );
}
else
{
if( PCB_GROUP* group = track->GetParentGroup() )
group->RemoveItem( track );
delete track;
}
}
aBoard->DeleteMARKERs();