Commit pending changes before quitting.

Fixes https://gitlab.com/kicad/code/kicad/issues/6239
This commit is contained in:
Jeff Young 2020-10-31 11:49:52 +00:00
parent 92d6988f10
commit 6cefec64ea
1 changed files with 7 additions and 1 deletions

View File

@ -580,6 +580,12 @@ void SCH_EDIT_FRAME::HardRedraw()
bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
{
// Exit interactive editing
// Note this this will commit *some* pending changes. For instance, the EE_POINT_EDITOR
// will cancel any drag currently in progress, but commit all changes from previous drags.
if( m_toolManager )
m_toolManager->RunAction( ACTIONS::cancelInteractive, true );
// Shutdown blocks must be determined and vetoed as early as possible
if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
&& Schematic().GetSheets().IsModified() )
@ -636,7 +642,7 @@ void SCH_EDIT_FRAME::doCloseWindow()
{
SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
// Shutdown all running tools ( and commit any pending change )
// Shutdown all running tools
if( m_toolManager )
m_toolManager->ShutdownAllTools();