From 046fef2cc130aa2b61df76476a981bf5d2d5d6bc Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 30 Aug 2020 12:27:20 -0400 Subject: [PATCH] Only load an empty project if we don't have one already We may have multiple projects if one of them is a temporary project used for importing settings Fixes https://gitlab.com/kicad/code/kicad/-/issues/5423 --- common/settings/settings_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index d52552cd65..7ef6a26cc4 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -741,7 +741,8 @@ bool SETTINGS_MANAGER::UnloadProject( PROJECT* aProject, bool aSave ) // Immediately reload a null project; this is required until the rest of the application // is refactored to not assume that Prj() always works - LoadProject( "" ); + if( m_projects.empty() ) + LoadProject( "" ); // Remove the reference in the environment to the previous project wxSetEnv( PROJECT_VAR_NAME, "" );