1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-17 16:50:26 +02:00

Modeless error shouldn't assert existence of a top window...

... Just make it modal if none.  Might only happen on macOS, and besides, the
modeless error dialog isn't (yet) used anywhere.  So this is not very important,
but I don't like assertions of things not really provably true.
This commit is contained in:
Paul Licameli 2021-07-10 12:27:13 -04:00
parent 189c6c1dbc
commit a656c9ce1a

View File

@ -65,11 +65,13 @@ void wxWidgetsBasicUI::DoShowErrorDialog(
#endif
}
case ErrorDialogType::ModelessError: {
modal = false;
// ensure it has some parent.
if( !parent )
if (!parent)
parent = wxTheApp->GetTopWindow();
wxASSERT(parent);
// To be nonmodal, either it needs a parent, to avoid leaks, or it must
// guarantee eventual deletion of itself. There might be no top window
// on MacOS. Let's just force it to be modal in that case.
if (parent)
modal = false;
break;
}
default: