Improve shutdown performance.

This commit is contained in:
Jeff Young 2020-08-21 19:12:51 +01:00
parent 97c34e2516
commit 80846dcbc7
4 changed files with 8 additions and 2 deletions

View File

@ -84,7 +84,8 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
m_autoSaveState( false ), m_autoSaveState( false ),
m_autoSaveInterval(-1 ), m_autoSaveInterval(-1 ),
m_UndoRedoCountMax( DEFAULT_MAX_UNDO_ITEMS ), m_UndoRedoCountMax( DEFAULT_MAX_UNDO_ITEMS ),
m_userUnits( EDA_UNITS::MILLIMETRES ) m_userUnits( EDA_UNITS::MILLIMETRES ),
m_shuttingDown( false )
{ {
m_autoSaveTimer = new wxTimer( this, ID_AUTO_SAVE_TIMER ); m_autoSaveTimer = new wxTimer( this, ID_AUTO_SAVE_TIMER );
m_mruPath = wxStandardPaths::Get().GetDocumentsDir(); m_mruPath = wxStandardPaths::Get().GetDocumentsDir();
@ -656,7 +657,7 @@ void EDA_BASE_FRAME::UpdateFileHistory( const wxString& FullFileName, FILE_HISTO
aFileHistory->AddFileToHistory( FullFileName ); aFileHistory->AddFileToHistory( FullFileName );
// Update the menubar to update the file history menu // Update the menubar to update the file history menu
if( GetMenuBar() ) if( !m_shuttingDown && GetMenuBar() )
{ {
ReCreateMenuBar(); ReCreateMenuBar();
GetMenuBar()->Refresh(); GetMenuBar()->Refresh();

View File

@ -629,6 +629,7 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
// //
// OK, we're really closing now. No more returns after this. // OK, we're really closing now. No more returns after this.
// //
m_shuttingDown = true;
// Shutdown all running tools ( and commit any pending change ) // Shutdown all running tools ( and commit any pending change )
if( m_toolManager ) if( m_toolManager )

View File

@ -163,6 +163,8 @@ protected:
EDA_UNITS m_userUnits; EDA_UNITS m_userUnits;
bool m_shuttingDown;
// Map containing the UI update handlers registered with wx for each action // Map containing the UI update handlers registered with wx for each action
std::map<int, UIUpdateHandler> m_uiUpdateMap; std::map<int, UIUpdateHandler> m_uiUpdateMap;

View File

@ -813,6 +813,8 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
} }
} }
m_shuttingDown = true;
// On Windows 7 / 32 bits, on OpenGL mode only, Pcbnew crashes // On Windows 7 / 32 bits, on OpenGL mode only, Pcbnew crashes
// when closing this frame if a footprint was selected, and the footprint editor called // when closing this frame if a footprint was selected, and the footprint editor called
// to edit this footprint, and when closing pcbnew if this footprint is still selected // to edit this footprint, and when closing pcbnew if this footprint is still selected