Remove DRC exclusions that no longer have items.
Fixes https://gitlab.com/kicad/code/kicad/issues/13802
This commit is contained in:
parent
7bc79c17d4
commit
13391176ae
|
@ -316,6 +316,20 @@ std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions()
|
|||
{
|
||||
PCB_MARKER* marker = PCB_MARKER::Deserialize( exclusionData );
|
||||
|
||||
if( !marker )
|
||||
continue;
|
||||
|
||||
// Check to see if items still exist
|
||||
for( const KIID& guid : marker->GetRCItem()->GetIDs() )
|
||||
{
|
||||
if( GetItem( guid ) == DELETED_BOARD_ITEM::GetInstance() )
|
||||
{
|
||||
delete marker;
|
||||
marker = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( marker )
|
||||
{
|
||||
marker->SetExcluded( true );
|
||||
|
|
|
@ -987,10 +987,7 @@ void PCB_EDIT_FRAME::ResolveDRCExclusions()
|
|||
for( PCB_MARKER* marker : GetBoard()->Markers() )
|
||||
{
|
||||
if( marker->GetSeverity() == RPT_SEVERITY_EXCLUSION )
|
||||
{
|
||||
GetCanvas()->GetView()->Remove( marker );
|
||||
GetCanvas()->GetView()->Add( marker );
|
||||
}
|
||||
GetCanvas()->GetView()->Update( marker );
|
||||
}
|
||||
|
||||
GetBoard()->UpdateRatsnestExclusions();
|
||||
|
|
Loading…
Reference in New Issue