Release file before re-loading it for Revert.

Fixes https://gitlab.com/kicad/code/kicad/issues/11481
This commit is contained in:
Jeff Young 2022-04-26 22:28:10 +01:00
parent e7f5deedb8
commit 8a97a46e6b
2 changed files with 3 additions and 0 deletions

View File

@ -146,6 +146,7 @@ int SCH_EDITOR_CONTROL::Revert( const TOOL_EVENT& aEvent )
for( SCH_SCREEN* screen = screenList.GetFirst(); screen; screen = screenList.GetNext() )
screen->SetContentModified( false ); // do not prompt the user for changes
m_frame->ReleaseFile();
m_frame->OpenProjectFiles( std::vector<wxString>( 1, schematic.GetFileName() ) );
return 0;

View File

@ -380,6 +380,8 @@ bool PCB_EDIT_FRAME::Files_io_from_id( int id )
GetScreen()->SetContentModified( false ); // do not prompt the user for changes
ReleaseFile();
return OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) );
}