Fix crash when closing non-modal

This commit is contained in:
Seth Hillbrand 2023-01-12 13:21:22 -08:00
parent fa91d906d0
commit a5e6f11682
3 changed files with 3 additions and 3 deletions

View File

@ -224,7 +224,7 @@ struct APP_SINGLE_TOP : public wxApp
dlgs.push_back( dialog ); dlgs.push_back( dialog );
} }
// Under GTK, sometimes the modal flag is cleared before hiding // Under GTK, sometimes the modal flag is cleared before hiding
else if( !event.IsShown() ) else if( !event.IsShown() && !dlgs.empty() )
{ {
// If we close the expected dialog, remove it from our stack // If we close the expected dialog, remove it from our stack
if( dlgs.back() == dialog ) if( dlgs.back() == dialog )

View File

@ -485,7 +485,7 @@ struct APP_KICAD : public wxApp
dlgs.push_back( dialog ); dlgs.push_back( dialog );
} }
// Under GTK, sometimes the modal flag is cleared before hiding // Under GTK, sometimes the modal flag is cleared before hiding
else if( !event.IsShown() ) else if( !event.IsShown() && !dlgs.empty() )
{ {
// If we close the expected dialog, remove it from our stack // If we close the expected dialog, remove it from our stack
if( dlgs.back() == dialog ) if( dlgs.back() == dialog )

View File

@ -512,7 +512,7 @@ struct APP_KICAD_CLI : public wxAppConsole
dlgs.push_back( dialog ); dlgs.push_back( dialog );
} }
// Under GTK, sometimes the modal flag is cleared before hiding // Under GTK, sometimes the modal flag is cleared before hiding
else if( !event.IsShown() ) else if( !event.IsShown() && !dlgs.empty() )
{ {
// If we close the expected dialog, remove it from our stack // If we close the expected dialog, remove it from our stack
if( dlgs.back() == dialog ) if( dlgs.back() == dialog )