From 01181ccb2f68ed0c4a282df117110df5d1bef76a Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 11 Jan 2021 22:17:13 -0500 Subject: [PATCH] Make sure project is unlinked before deleting it Fixes https://gitlab.com/kicad/code/kicad/-/issues/7038 --- pcbnew/files.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index beddd5951c..1675372c90 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -581,9 +581,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& 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& aFileSet, in // calls SaveProject SaveProjectSettings(); + GetBoard()->ClearProject(); mgr->UnloadProject( &mgr->Prj() ); mgr->LoadProject( pro.GetFullPath() );