X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/faaa88e7abcb48c0564d39f1a69bb3d19df0fe16..fada8bef05c36e3bae29f9442f8d32b024905207:/src/gtk/filepicker.cpp diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 9e099cc444..73aab00df1 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -81,6 +81,7 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id, // NOTE: we deliberately ignore the given label as GtkFileChooserButton // use as label the currently selected file m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget ); + g_object_ref(m_widget); gtk_widget_show(m_widget); // we need to know when the dialog has been dismissed clicking OK... @@ -103,12 +104,6 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id, wxFileButton::~wxFileButton() { - // GtkFileChooserButton will automatically destroy the - // GtkFileChooserDialog associated with m_dialog. - // Thus we have to set its m_widget to NULL to avoid - // double destruction on same widget - if (m_dialog) - m_dialog->m_widget = NULL; } void wxFileButton::OnDialogOK(wxCommandEvent& ev) @@ -229,6 +224,7 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, // NOTE: we deliberately ignore the given label as GtkFileChooserButton // use as label the currently selected file m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget ); + g_object_ref(m_widget); gtk_widget_show(m_widget); @@ -249,12 +245,6 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, wxDirButton::~wxDirButton() { - // GtkFileChooserButton will automatically destroy the - // GtkFileChooserDialog associated with m_dialog. - // Thus we have to set its m_widget to NULL to avoid - // double destruction on same widget - if (m_dialog) - m_dialog->m_widget = NULL; } void wxDirButton::SetPath(const wxString& str)