]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dialogs/dialogs.cpp
delete singleInstanceChecker when exiting
[wxWidgets.git] / samples / dialogs / dialogs.cpp
index 8e551bdc64fa5baa2ba5eeef9d7fe50432a332a8..fecd4b0ec3079131cb6f78bb4940dc016fe7a22a 100644 (file)
@@ -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