modedit: clear the pcb when closing the window

Before closing the window in the footprint editor, we clear the existing
pcb, undo/redo stack and associated memory to prevent callbacks
double-freeing on destruction.

Fixes: lp:1784504
* https://bugs.launchpad.net/kicad/+bug/1784504
This commit is contained in:
Seth Hillbrand 2018-08-28 12:33:33 -07:00
parent 0ac96d177c
commit c6d1433523
1 changed files with 5 additions and 0 deletions

View File

@ -503,7 +503,12 @@ void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
}
if( IsGalCanvasActive() )
{
GetGalCanvas()->SetEventDispatcher( NULL );
GetGalCanvas()->StopDrawing();
}
Clear_Pcb( false );
//close the editor
Destroy();