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.
This commit is contained in:
Wayne Stambaugh 2020-09-01 16:52:05 -04:00
parent ac73c99842
commit c17f832de1
1 changed files with 3 additions and 3 deletions

View File

@ -347,14 +347,14 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& 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() ) );