Block off potential errant double activation of tree project items

Additional fix for #6606

Cherrypick from 535dbc1a06
This commit is contained in:
Mark Roszko 2020-12-04 02:15:07 +00:00
parent d7a6a2cc71
commit be8fe7bdd6
1 changed files with 6 additions and 2 deletions

View File

@ -843,8 +843,12 @@ void TREE_PROJECT_FRAME::OnIdle( wxIdleEvent& aEvent )
// This makes it ideal to launch a new window without starting Focus wars.
if( m_selectedItem != nullptr )
{
m_selectedItem->Activate( this );
m_selectedItem = nullptr;
// Activate launches a window which may run the event loop on top of us
// and cause OnIdle here to get called again, so be sure to block off the activation condition first
PROJECT_TREE_ITEM* item = m_selectedItem;
m_selectedItem = nullptr;
item->Activate( this );
}
}