From eb171a45923624b5742254c0f483eb2ae2873213 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Dec 2014 22:18:16 +0000 Subject: [PATCH] Don't dereference wxTheApp unconditionally when showing wxMessageDialog. The application might not yet (or already) exist, don't crash in this case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/msgdlg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 1ad42ad427..ed3354f4fc 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -430,7 +430,7 @@ wxFont wxMessageDialog::GetMessageFont() int wxMessageDialog::ShowMessageBox() { - if ( !wxTheApp->GetTopWindow() ) + if ( wxTheApp && !wxTheApp->GetTopWindow() ) { // when the message box is shown from wxApp::OnInit() (i.e. before the // message loop is entered), this must be done or the next message box