Fix crash when using wxMessageBox before creating wxTheApp.

CheckIfCanBeUsedAsParent() used by wxMessageBox ctor shouldn't dereference
wxTheApp unconditionally, otherwise it's impossible to show a message box
before creating the application object or after destroying it without crashing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-05 22:18:13 +00:00
parent c6cd1a305e
commit e91fb2bbee

View File

@@ -189,7 +189,7 @@ wxDialogBase::GetParentForModalDialog(wxWindow *parent, long style) const
wxGetTopLevelParent(wxGetActiveWindow()));
// and finally the application main window
if ( !parent )
if ( !parent && wxTheApp )
parent = CheckIfCanBeUsedAsParent(wxTheApp->GetTopWindow());
return parent;