From 3b1de0dc8b9dea27e90b534f28620bbaac5cacc2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Oct 2014 12:56:37 +0000 Subject: [PATCH] Use TLW parent for wxMessageDialog in all ports. This avoids problems with deleting child windows which are parents of wxMessageDialog before the dialog itself is destroyed and was already done in wxGTK, but not in wxMSW nor wxOSX. Do it in all ports now by calling GetParentForModalDialog() from wxMessageDialogBase ctor itself instead of depending on the port-specific wxMessageDialog to do it. Closes #16631. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msgdlg.h | 2 +- src/gtk/msgdlg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index 10f9ed6a07..ab7660d2b7 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -92,7 +92,7 @@ public: : m_message(message), m_caption(caption) { - m_parent = parent; + m_parent = GetParentForModalDialog(parent, style); SetMessageDialogStyle(style); } diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index 8bc0dae840..86a7b786cc 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -48,7 +48,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxPoint& WXUNUSED(pos)) : wxMessageDialogBase ( - GetParentForModalDialog(parent, style), + parent, message, caption, style