Make sure project is unlinked before deleting it

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7038
This commit is contained in:
Jon Evans 2021-01-11 22:17:13 -05:00
parent 8a1a1aba5d
commit 01181ccb2f
1 changed files with 1 additions and 3 deletions

View File

@ -581,9 +581,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// consumming, so display a busy cursor
wxBusyCursor dummy;
// Unlink the old project if needed
GetBoard()->ClearProject();
// No save prompt (we already prompted above), and only reset to a new blank board if new
Clear_Pcb( false, !is_new );
@ -603,6 +600,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// calls SaveProject
SaveProjectSettings();
GetBoard()->ClearProject();
mgr->UnloadProject( &mgr->Prj() );
mgr->LoadProject( pro.GetFullPath() );