Save project to disk whenever we save the board to disk.

This prevents data loss in the event of a subsequent crash.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14991
This commit is contained in:
Jeff Young 2023-06-26 16:48:56 +01:00
parent 1b7473c353
commit 3bdc66d3ed
1 changed files with 5 additions and 1 deletions

View File

@ -1042,7 +1042,11 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
projectFile.SetExt( ProjectFileExtension );
rulesFile.SetExt( DesignRulesFileExtension );
if( !projectFile.FileExists() && aChangeProject )
if( projectFile.FileExists() )
{
GetSettingsManager()->SaveProject();
}
else if( aChangeProject )
{
Prj().SetReadOnly( false );
GetSettingsManager()->SaveProjectAs( projectFile.GetFullPath() );