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.

(cherry picked from commit cabfcbc73c)
This commit is contained in:
Seth Hillbrand 2019-06-28 19:23:00 -07:00
parent 16cf1a4d09
commit 3a94ccd6a3
1 changed files with 8 additions and 0 deletions

View File

@ -556,6 +556,14 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
case PCB_TRACE_T: case PCB_TRACE_T:
case PCB_VIA_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 ) if( aMode == ADD_APPEND )
m_tracks.push_back( static_cast<TRACK*>( aBoardItem ) ); m_tracks.push_back( static_cast<TRACK*>( aBoardItem ) );
else else