cvpcb: Clear modules in board

The iterators are not removal safe outside of the class.  We provide a
safety clear function that frees the associated memory.

Fixes: lp:1831465
* https://bugs.launchpad.net/kicad/+bug/1831465
This commit is contained in:
Seth Hillbrand 2019-06-03 07:04:04 -07:00
parent 59a01789ff
commit a0ef3f81f4
1 changed files with 2 additions and 4 deletions

View File

@ -380,10 +380,8 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
MODULE* module = nullptr;
const FOOTPRINT_INFO* module_info = nullptr;
for( auto it = GetBoard()->Modules().begin(); it != GetBoard()->Modules().end(); it++ )
delete *it;
GetBoard()->Modules().clear();
GetBoard()->DeleteAllModules();
GetGalCanvas()->GetView()->Clear();
wxString footprintName = parentframe->GetSelectedFootprint();