// Author: Francesco Montorsi
// Modified By:
// Created: 15/04/2006
-// Id: $Id$
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxFileButton::~wxFileButton()
{
- delete m_dialog;
+ if ( m_dialog )
+ {
+ // when m_dialog is deleted, it will destroy the widget it is sharing
+ // with GtkFileChooserButton, which results in a bunch of Gtk-CRITICAL
+ // errors from GtkFileChooserButton. To avoid this, call gtk_widget_destroy()
+ // on GtkFileChooserButton first (our base dtor will do it again, but
+ // that does no harm). m_dialog holds a reference to the shared widget,
+ // so it won't go away until m_dialog base dtor unrefs it.
+ gtk_widget_destroy(m_widget);
+ delete m_dialog;
+ }
}
void wxFileButton::OnDialogOK(wxCommandEvent& ev)
wxDirButton::~wxDirButton()
{
- delete m_dialog;
+ if (m_dialog)
+ {
+ // see ~wxFileButton() comment
+ gtk_widget_destroy(m_widget);
+ delete m_dialog;
+ }
}
void wxDirButton::GTKUpdatePath(const char *gtkpath)