diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 17353aa115..d365ccfb82 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -316,6 +316,20 @@ std::vector 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 ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 60e39bf7e6..c7bde0bd34 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -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();