X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/455f7c8205e5dc29d99026b158ae0a394dccc839..2f21b2be1be5d7f0e77f08635962eca3fad75f8b:/src/motif/dialog.cpp?ds=inline diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index ceb4ca922e..3955a68d45 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -183,6 +183,9 @@ wxDialog::~wxDialog() { m_isBeingDeleted = true; + // if the dialog is modal, this will end its event loop + Show(false); + delete m_eventLoop; if (m_mainWidget) @@ -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)