From: Vadim Zeitlin Date: Sun, 19 May 2013 12:38:18 +0000 (+0000) Subject: Delete the associated dialog in wxGTK wx{File,Dir}Button. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/055342681483c4c9e6f542984865ac0543a58c6b Delete the associated dialog in wxGTK wx{File,Dir}Button. The code seemed to rely on Destroy() being called for deleting the dialog, but it's actually not used for child windows, so do it in dtor instead. Closes #15156. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/filepicker.h b/include/wx/gtk/filepicker.h index 68a59090e0..c73e4dbba4 100644 --- a/include/wx/gtk/filepicker.h +++ b/include/wx/gtk/filepicker.h @@ -34,13 +34,6 @@ return NULL; \ } \ \ - virtual bool Destroy() \ - { \ - if (m_dialog) \ - m_dialog->Destroy(); \ - return wxButton::Destroy(); \ - } \ - \ /* even if wx derive from wxGenericFileButton, i.e. from wxButton, our */ \ /* native GTK+ widget does not derive from GtkButton thus *all* uses */ \ /* GTK_BUTTON(m_widget) macro done by wxButton must be bypassed to */ \ diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 2d1d3b6f5f..104d7d5d92 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -103,6 +103,7 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id, wxFileButton::~wxFileButton() { + delete m_dialog; } void wxFileButton::OnDialogOK(wxCommandEvent& ev) @@ -258,6 +259,7 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, wxDirButton::~wxDirButton() { + delete m_dialog; } void wxDirButton::GTKUpdatePath(const char *gtkpath)