From 7161c5bdd516691788d993ee363e5f7c2d80a2e3 Mon Sep 17 00:00:00 2001 From: Kirill Mavreshko Date: Sun, 13 Jul 2014 19:08:42 +0200 Subject: [PATCH] bugfix: pcbnew crashes when you try to save a file --- pcbnew/kicad_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 3cfb646176..8c04a1e192 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -63,12 +63,14 @@ static const wxString traceFootprintLibrary( wxT( "KicadFootprintLib" ) ); ///> Removes empty nets (i.e. with node count equal zero) from net classes 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 ); 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; } }