Fix race condition with ShowEventCounters on Windows

(cherry picked from commit 3dd8c57bdd)
This commit is contained in:
Marek Roszko 2021-12-26 08:29:54 -05:00 committed by Mark Roszko
parent 6edc605cab
commit ceb4d08ce9
1 changed files with 7 additions and 0 deletions

View File

@ -395,6 +395,13 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
PCB_EDIT_FRAME::~PCB_EDIT_FRAME() PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
{ {
if( ADVANCED_CFG::GetCfg().m_ShowEventCounters )
{
// Stop the timer during destruction early to avoid potential event race conditions (that do happen on windows)
m_eventCounterTimer->Stop();
delete m_eventCounterTimer;
}
// Close modeless dialogs // Close modeless dialogs
wxWindow* open_dlg = wxWindow::FindWindowByName( DIALOG_DRC_WINDOW_NAME ); wxWindow* open_dlg = wxWindow::FindWindowByName( DIALOG_DRC_WINDOW_NAME );