diff options
author | Timm Bäder <tbaeder@redhat.com> | 2019-05-03 08:10:50 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2019-05-03 20:06:23 +0200 |
commit | 596c9a3c0b9511a1e3ffdc14ffc0b2a66cdb0e70 (patch) | |
tree | 4f2ef81a3135b1013fb26560db9f7a42192adc27 /gtk/gtkfilechooserbutton.c | |
parent | c675d1c9e154dae9f1f87a7f8e0ed820f81bff88 (diff) | |
download | gtk+-596c9a3c0b9511a1e3ffdc14ffc0b2a66cdb0e70.tar.gz |
filechooserbutton: Clear model in destroy()
Since we're destroying priv->chooser right after. We can't wait until
finalize() since clearing the model will try to work with priv->chooser.
Diffstat (limited to 'gtk/gtkfilechooserbutton.c')
-rw-r--r-- | gtk/gtkfilechooserbutton.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index ea9de54450..ef4e000d90 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -994,12 +994,6 @@ gtk_file_chooser_button_finalize (GObject *object) if (priv->current_folder_while_inactive) g_object_unref (priv->current_folder_while_inactive); - if (priv->model) - { - model_remove_rows (button, 0, gtk_tree_model_iter_n_children (priv->model, NULL)); - g_object_unref (priv->model); - } - gtk_widget_unparent (priv->button); gtk_widget_unparent (priv->combo_box); @@ -1032,6 +1026,12 @@ gtk_file_chooser_button_destroy (GtkWidget *widget) GtkFileChooserButtonPrivate *priv = gtk_file_chooser_button_get_instance_private (button); GSList *l; + if (priv->model) + { + model_remove_rows (button, 0, gtk_tree_model_iter_n_children (priv->model, NULL)); + g_clear_object (&priv->model); + } + if (priv->dialog != NULL) { gtk_widget_destroy (priv->dialog); |