X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a6739128bcb9b5b68f0c2e74170ef62663b3a7..591cc82deb5bc6dd0af6047ecfa7ce7cf4f8d859:/src/msw/dialog.cpp?ds=inline diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 7b4ad2baaa..c7baa0359c 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -147,7 +147,6 @@ void wxDialog::Init() { m_isShown = false; m_modalData = NULL; - m_endModalCalled = false; #if wxUSE_TOOLBAR && defined(__POCKETPC__) m_dialogToolBar = NULL; #endif @@ -281,14 +280,11 @@ int wxDialog::ShowModal() { wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") ); - m_endModalCalled = false; - Show(); // EndModal may have been called from InitDialog handler (called from - // inside Show()), which would cause an infinite loop if we didn't take it - // into account - if ( !m_endModalCalled ) + // inside Show()) and hidden the dialog back again + if ( IsShown() ) { // enter and run the modal loop wxDialogModalDataTiedPtr modalData(&m_modalData, @@ -303,7 +299,6 @@ void wxDialog::EndModal(int retCode) { wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") ); - m_endModalCalled = true; SetReturnCode(retCode); Hide();