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

(cherry picked from commit 3bdc66d3ed)
This commit is contained in:
Jeff Young 2023-06-26 16:48:56 +01:00
parent b294530716
commit 60fe2ce30e
1 changed files with 5 additions and 1 deletions

View File

@ -1052,7 +1052,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() );