diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 7782ed2fca..2572cbdbfd 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -273,6 +273,9 @@ bool EDA_BASE_FRAME::ProcessEvent( wxEvent& aEvent ) if( !wxFrame::ProcessEvent( aEvent ) ) return false; + if( Pgm().m_Quitting ) + return true; + if( !m_isClosing && m_hasAutoSave && IsShown() && IsActive() && m_autoSaveState != isAutoSaveRequired() && m_autoSaveInterval > 0 ) diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 556918ae13..d9ddaa3991 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -108,6 +108,7 @@ PGM_BASE::PGM_BASE() { m_locale = nullptr; m_Printing = false; + m_Quitting = false; m_ModalDialogCount = 0; setLanguageId( wxLANGUAGE_DEFAULT ); diff --git a/include/pgm_base.h b/include/pgm_base.h index c78d0d159c..72ab349391 100644 --- a/include/pgm_base.h +++ b/include/pgm_base.h @@ -292,6 +292,8 @@ public: int m_ModalDialogCount; + bool m_Quitting; + protected: /// Loads internal settings from COMMON_SETTINGS void loadCommonSettings(); diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 39e1da7b4c..01ab78590b 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -435,6 +435,8 @@ bool KICAD_MANAGER_FRAME::CloseProject( bool aSave ) m_leftWin->EmptyTreePrj(); + Pgm().m_Quitting = true; + return true; }