From d0773cbe89764f610bfac5a00896e6511912bd19 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 29 Sep 2020 14:08:10 +0100 Subject: [PATCH] Be more careful with iterators when deleting. Fixes https://gitlab.com/kicad/code/kicad/issues/5811 --- pcbnew/zone_filler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index fa5356e522..f443e1fd10 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -372,7 +372,7 @@ bool ZONE_FILLER::Fill( std::vector& aZones, bool aCheck, wxWin SHAPE_POLY_SET poly = zone->GetFilledPolysList( layer ); - for( int ii = 0; ii < poly.OutlineCount(); ii++ ) + for( int ii = poly.OutlineCount() - 1; ii >= 0; ii-- ) { std::vector& island = poly.Polygon( ii );