From 596c9a3c0b9511a1e3ffdc14ffc0b2a66cdb0e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 3 May 2019 08:10:50 +0200 Subject: 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. --- gtk/gtkfilechooserbutton.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gtk/gtkfilechooserbutton.c') 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); -- cgit v1.2.1