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:
parent
59a01789ff
commit
a0ef3f81f4
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue