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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user