X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6212a0cb7e6285f62198a9411d91bbe8dc06e60..821d856a610b21f2946e3283db7f79443227776e:/src/motif/dialog.cpp diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 347e11354c..25515e450a 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -21,6 +21,7 @@ #endif #include "wx/evtloop.h" +#include "wx/modalhook.h" #ifdef __VMS__ #pragma message disable nosimpint @@ -62,8 +63,6 @@ extern wxList wxModelessWindows; // Frames and modeless dialogs #define wxUSE_INVISIBLE_RESIZE 1 -IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) - wxDialog::wxDialog() { m_modalShowing = false; @@ -290,6 +289,8 @@ bool wxDialog::Show( bool show ) // Shows a dialog modally, returning a return code int wxDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + Show(true); // after the event loop ran, the widget might already have been destroyed @@ -307,8 +308,7 @@ int wxDialog::ShowModal() // Now process all events in case they get sent to a destroyed dialog wxFlushEvents( display ); - delete m_eventLoop; - m_eventLoop = NULL; + wxDELETE(m_eventLoop); // TODO: is it safe to call this, if the dialog may have been deleted // by now? Probably only if we're using delayed deletion of dialogs.