bugfix: pcbnew crashes when you try to save a file
This commit is contained in:
parent
7d1c1f3085
commit
ae44fb62fc
|
@ -63,12 +63,14 @@ static const wxString traceFootprintLibrary( wxT( "KicadFootprintLib" ) );
|
||||||
///> Removes empty nets (i.e. with node count equal zero) from net classes
|
///> Removes empty nets (i.e. with node count equal zero) from net classes
|
||||||
void filterNetClass( const BOARD& aBoard, NETCLASS& aNetClass )
|
void filterNetClass( const BOARD& aBoard, NETCLASS& aNetClass )
|
||||||
{
|
{
|
||||||
for( NETCLASS::const_iterator it = aNetClass.begin(); it != aNetClass.end(); ++it )
|
for( NETCLASS::const_iterator it = aNetClass.begin(); it != aNetClass.end(); )
|
||||||
{
|
{
|
||||||
NETINFO_ITEM* netinfo = aBoard.FindNet( *it );
|
NETINFO_ITEM* netinfo = aBoard.FindNet( *it );
|
||||||
|
|
||||||
if( netinfo && netinfo->GetNodesCount() <= 0 ) // hopefully there are no nets with negative
|
if( netinfo && netinfo->GetNodesCount() <= 0 ) // hopefully there are no nets with negative
|
||||||
aNetClass.Remove( it ); // node count, but you never know..
|
aNetClass.Remove( it++ ); // node count, but you never know..
|
||||||
|
else
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue