Suppress handling of selection events until delete is done.

Fixes https://gitlab.com/kicad/code/kicad/issues/13451
This commit is contained in:
Jeff Young 2023-01-23 19:57:54 +00:00
parent 4e50c5313d
commit 8eae75e8d6
1 changed files with 4 additions and 0 deletions

View File

@ -264,6 +264,10 @@ void PANEL_FP_PROPERTIES_3D_MODEL::OnRemove3DModel( wxCommandEvent& )
if( idx >= 0 && m_modelsGrid->GetNumberRows() && !m_shapes3D_list.empty() )
{
// Don't allow selection until we call select3DModel(), below. Otherwise wxWidgets
// has a tendency to get its knickers in a knot....
m_inSelect = true;
m_shapes3D_list.erase( m_shapes3D_list.begin() + idx );
m_modelsGrid->DeleteRows( idx );