Fix crash when closing non-modal
This commit is contained in:
parent
fa91d906d0
commit
a5e6f11682
|
@ -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 )
|
||||||
|
|
|
@ -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 )
|
||||||
|
|
|
@ -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 )
|
||||||
|
|
Loading…
Reference in New Issue