pcbnew: Drop tracks not on copper

We do not allow non-copper routed tracks and they will break assumptions
elsewhere in the code.  We drop them in the beginning so that they are
not saved.
This commit is contained in:
Seth Hillbrand 2019-06-28 19:23:00 -07:00
parent 574473c480
commit cabfcbc73c
1 changed files with 8 additions and 0 deletions

View File

@ -890,6 +890,14 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
case PCB_TRACE_T:
case PCB_VIA_T:
// N.B. This inserts a small memory leak as we lose the
if( !IsCopperLayer( aBoardItem->GetLayer() ) )
{
wxFAIL_MSG( wxT( "BOARD::Add() Cannot place Track on non-copper layer" ) );
return;
}
if( aMode == ADD_APPEND )
{
m_Track.PushBack( (TRACK*) aBoardItem );