X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc409d37f2fbd5fec4f8ae2676cfd87dbb479e4f..75e8e6dc29ce30e19ca195a08d9a5ece762c5f6e:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index bb0f74e2ef..dcdaec3cbe 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; @@ -88,11 +98,7 @@ void wxDialog::SetModal( bool WXUNUSED(flag) ) int wxDialog::ShowModal() { - if (IsModal()) - { - wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") ); - return GetReturnCode(); - } + wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" ); // release the mouse if it's currently captured as the window having it // will be disabled when this dialog is shown -- but will still keep the