]> git.saurik.com Git - wxWidgets.git/commitdiff
Delete the associated dialog in wxGTK wx{File,Dir}Button.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 May 2013 12:38:18 +0000 (12:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 May 2013 12:38:18 +0000 (12:38 +0000)
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

include/wx/gtk/filepicker.h
src/gtk/filepicker.cpp

index 68a59090e02d4ad9060f3b61bf29db07f082cf4d..c73e4dbba44824d99837ef252edff738805bb10a 100644 (file)
         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     */ \
index 2d1d3b6f5ff3e20a8cfff68630c99123a857dd05..104d7d5d92ab7fd35df7ea8d906c4d352c4a65b7 100644 (file)
@@ -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)