Avoid crash if wxMessageBox() is called before GTK is initialized

See https://github.com/wxWidgets/wxWidgets/pull/2099
This commit is contained in:
Paul Cornett
2020-10-23 09:20:08 -07:00
parent 15f1f7a9e5
commit 21d5f3f4a1

View File

@@ -109,6 +109,10 @@ void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label)
void wxMessageDialog::GTKCreateMsgDialog()
{
// Avoid crash if wxMessageBox() is called before GTK is initialized
if (g_type_class_peek(GDK_TYPE_DISPLAY) == NULL)
return;
GtkWindow * const parent = m_parent ? GTK_WINDOW(m_parent->m_widget) : NULL;
GtkMessageType type = GTK_MESSAGE_ERROR;