From db6f9f3e56eb75eb48771c9233ce3ef7f056832f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 12 Apr 2004 20:06:52 +0000 Subject: [PATCH] Don't unref model if it is NULL. (#139770) 2004-04-12 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_unset_model): Don't unref model if it is NULL. (#139770) --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-4 | 3 +++ ChangeLog.pre-2-6 | 3 +++ ChangeLog.pre-2-8 | 3 +++ gtk/gtkcombobox.c | 7 +++++-- 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cdfa77e7e..d0a63f180 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-04-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_unset_model): Don't unref + model if it is NULL. (#139770) + * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix. * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cdfa77e7e..d0a63f180 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-04-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_unset_model): Don't unref + model if it is NULL. (#139770) + * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix. * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index cdfa77e7e..d0a63f180 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,5 +1,8 @@ 2004-04-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_unset_model): Don't unref + model if it is NULL. (#139770) + * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix. * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cdfa77e7e..d0a63f180 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-04-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_unset_model): Don't unref + model if it is NULL. (#139770) + * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix. * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cdfa77e7e..d0a63f180 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-04-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_unset_model): Don't unref + model if it is NULL. (#139770) + * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix. * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 0690152ee..79942ee42 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -1483,8 +1483,11 @@ gtk_combo_box_unset_model (GtkComboBox *combo_box) (GtkCallback)gtk_widget_destroy, NULL); } - g_object_unref (G_OBJECT (combo_box->priv->model)); - combo_box->priv->model = NULL; + if (combo_box->priv->model) + { + g_object_unref (G_OBJECT (combo_box->priv->model)); + combo_box->priv->model = NULL; + } } static void -- 2.43.2