Unlink board from project before close

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4876
This commit is contained in:
Jon Evans 2020-07-13 20:48:18 -04:00
parent 97c360aa9b
commit d349b24f7a
1 changed files with 3 additions and 0 deletions

View File

@ -613,6 +613,9 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
if( m_show_layer_manager_tools )
m_auimgr.GetPane( "LayersManager" ).Show( false );
// Unlink the old project if needed
GetBoard()->ClearProject();
// Delete board structs and undo/redo lists, to avoid crash on exit
// when deleting some structs (mainly in undo/redo lists) too late
Clear_Pcb( false, true );