Prevent double-entry into footprint load

Avoids double-clicking on the footprint library symbol crashing due to
overwriting the global footprint table by multiple instances

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17040
This commit is contained in:
Seth Hillbrand 2024-04-19 17:20:31 -07:00
parent b346cde30b
commit 3435c6ebee
1 changed files with 6 additions and 0 deletions

View File

@ -257,6 +257,11 @@ protected:
if( fpid.IsEmpty() )
fpid = m_preselect;
// Disable the button until we have finished processing it. Normally this is not an issue
// but if the footprint chooser is loading for the first time, it can be slow enough that
// multiple clicks will cause multiple instances of the footprint loader process to start
Disable();
KIWAY_PLAYER* frame = m_dlg->Kiway().Player( FRAME_FOOTPRINT_CHOOSER, true, m_dlg );
if( !m_symbolNetlist.empty() )
@ -269,6 +274,7 @@ protected:
SetValue( fpid );
frame->Destroy();
Enable();
}
protected: