From c17f832de1beda69e5740907d3926ba5be834f71 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 1 Sep 2020 16:52:05 -0400 Subject: [PATCH] Eeschema: move auto save check before clearing current screen. GitLab issue #5068 only affected the 5.1 branch. The same issue could also affect master if for some reason a context switch occurs due to changes. Moving the auto save feature before setting the current screen to null should mitigate any potential future issues. --- eeschema/files-io.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index d5c7c59054..746d867833 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -347,14 +347,14 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in } else { + // This will rename the file if there is an autosave and the user want to recover. + CheckForAutoSaveFile( fullFileName ); + SetScreen( nullptr ); SCH_PLUGIN* plugin = SCH_IO_MGR::FindPlugin( schFileType ); SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( plugin ); - // This will rename the file if there is an autosave and the user want to recover - CheckForAutoSaveFile( fullFileName ); - try { Schematic().SetRoot( pi->Load( fullFileName, &Schematic() ) );