X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3aa8e4ea6db0478d3bc862f59f100408bdc8732f..e86f2cc84aabc8a58b1984c1ed7fb9475f6abe67:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 7a4f9e3009..c70813d557 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -69,13 +69,23 @@ bool wxDialog::Show( bool show ) if (show && CanDoLayoutAdaptation()) DoLayoutAdaptation(); - bool ret = wxWindow::Show( show ); + bool ret = wxDialogBase::Show(show); - if (show) InitDialog(); + if (show) + InitDialog(); return ret; } +wxDialog::~wxDialog() +{ + m_isBeingDeleted = true; + + // if the dialog is modal, this will end its event loop + if ( IsModal() ) + EndModal(wxID_CANCEL); +} + bool wxDialog::IsModal() const { return m_modalShowing; @@ -139,7 +149,7 @@ void wxDialog::EndModal( int retCode ) if (!IsModal()) { - wxFAIL_MSG( wxT("wxDialog:EndModal called twice") ); + wxFAIL_MSG( "either wxDialog:EndModal called twice or ShowModal wasn't called" ); return; }