X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/455f7c8205e5dc29d99026b158ae0a394dccc839..51c72a7b56ea50fb3c9b082da1bbaddf6a218073:/src/motif/dialog.cpp?ds=sidebyside diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index ceb4ca922e..347e11354c 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -181,7 +181,10 @@ void wxDialog::SetModal(bool flag) wxDialog::~wxDialog() { - m_isBeingDeleted = true; + SendDestroyEvent(); + + // if the dialog is modal, this will end its event loop + Show(false); delete m_eventLoop; @@ -241,6 +244,9 @@ bool wxDialog::Show( bool show ) if( !wxWindowBase::Show( show ) ) return false; + if ( !show && IsModal() ) + EndModal(wxID_CANCEL); + m_isShown = show; if (show)