From 26a12ab34cc822b99eb0c0431a4d299dcc2c32c8 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 16 Feb 2005 14:44:15 +0000 Subject: [PATCH] Added assert (WinCE doesn't report checked status correctly) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dialogs/dialogs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 8e551bdc64..fecd4b0ec3 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -905,7 +905,14 @@ void MyFrame::ModelessDlg(wxCommandEvent& event) } else // hide { - m_dialog->Hide(); + // If m_dialog is NULL, then possibly the system + // didn't report the checked menu item status correctly. + // It should be true just after the menu item was selected, + // if there was no modeless dialog yet. + + wxASSERT( m_dialog != NULL ); + if (m_dialog) + m_dialog->Hide(); } } #endif // USE_MODAL_PRESENTATION -- 2.45.2