X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/71d1d0e2e65268a8864625b709db296987b1a68c..9928536b3a83586c473c96000c2d3a32e4c3f576:/src/univ/dialog.cpp diff --git a/src/univ/dialog.cpp b/src/univ/dialog.cpp index 79114b0d36..c98a5e91ac 100644 --- a/src/univ/dialog.cpp +++ b/src/univ/dialog.cpp @@ -53,6 +53,11 @@ void wxDialog::Init() wxDialog::~wxDialog() { + m_isBeingDeleted = true; + + // if the dialog is modal, this will end its event loop + Show(false); + delete m_eventLoop; } @@ -71,7 +76,7 @@ bool wxDialog::Create(wxWindow *parent, void wxDialog::OnApply(wxCommandEvent &WXUNUSED(event)) { - if ( Validate() ) + if ( Validate() ) TransferDataFromWindow(); } @@ -150,9 +155,12 @@ bool wxDialog::Show(bool show) EndModal(wxID_CANCEL); } + if (show && CanDoLayoutAdaptation()) + DoLayoutAdaptation(); + bool ret = wxDialogBase::Show(show); - if ( show ) + if ( show ) InitDialog(); return ret;