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 f6d9c3a733
commit b7a321d143
1 changed files with 5 additions and 0 deletions

View File

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