From 03646f37b11f5ac899be01f1c5bf3ab96b13d5dd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 1 Oct 2004 18:56:14 +0000 Subject: [PATCH] Silently ignore info being NULL. This is unavoidable with the current 2004-10-01 Matthias Clasen * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_layout_clear_attributes): Silently ignore info being NULL. This is unavoidable with the current design where we have every implementation of layout_clear call layout_clear_attributes, and also delegate calls to dependent cell layouts. (#154191, Martyn Russell) --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtkcellview.c | 19 ++++++++++--------- gtk/gtktreeviewcolumn.c | 3 ++- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8aadf08eb0..e62c55184f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-10-01 Matthias Clasen + + * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_layout_clear_attributes): + Silently ignore info being NULL. This is unavoidable with the + current design where we have every implementation of layout_clear + call layout_clear_attributes, and also delegate calls to dependent + cell layouts. (#154191, Martyn Russell) + 2004-10-01 Matthias Clasen * modules/input/iminuktitut.c: Fix the spelling of Inuktitut diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8aadf08eb0..e62c55184f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2004-10-01 Matthias Clasen + + * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_layout_clear_attributes): + Silently ignore info being NULL. This is unavoidable with the + current design where we have every implementation of layout_clear + call layout_clear_attributes, and also delegate calls to dependent + cell layouts. (#154191, Martyn Russell) + 2004-10-01 Matthias Clasen * modules/input/iminuktitut.c: Fix the spelling of Inuktitut diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8aadf08eb0..e62c55184f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +2004-10-01 Matthias Clasen + + * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_layout_clear_attributes): + Silently ignore info being NULL. This is unavoidable with the + current design where we have every implementation of layout_clear + call layout_clear_attributes, and also delegate calls to dependent + cell layouts. (#154191, Martyn Russell) + 2004-10-01 Matthias Clasen * modules/input/iminuktitut.c: Fix the spelling of Inuktitut diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8aadf08eb0..e62c55184f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2004-10-01 Matthias Clasen + + * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_layout_clear_attributes): + Silently ignore info being NULL. This is unavoidable with the + current design where we have every implementation of layout_clear + call layout_clear_attributes, and also delegate calls to dependent + cell layouts. (#154191, Martyn Russell) + 2004-10-01 Matthias Clasen * modules/input/iminuktitut.c: Fix the spelling of Inuktitut diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c index a68d03482e..84c3bc8dd8 100644 --- a/gtk/gtkcellview.c +++ b/gtk/gtkcellview.c @@ -706,17 +706,18 @@ gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout *layout, g_return_if_fail (GTK_IS_CELL_RENDERER (renderer)); info = gtk_cell_view_get_cell_info (cellview, renderer); - g_return_if_fail (info != NULL); - - list = info->attributes; - while (list && list->next) + if (info != NULL) { - g_free (list->data); - list = list->next->next; + list = info->attributes; + while (list && list->next) + { + g_free (list->data); + list = list->next->next; + } + + g_slist_free (info->attributes); + info->attributes = NULL; } - - g_slist_free (info->attributes); - info->attributes = NULL; } static void diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index eea8180433..686c049220 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -764,7 +764,8 @@ gtk_tree_view_column_cell_layout_clear_attributes (GtkCellLayout *cell_layout column = GTK_TREE_VIEW_COLUMN (cell_layout); info = gtk_tree_view_column_get_cell_info (column, cell_renderer); - gtk_tree_view_column_clear_attributes_by_info (column, info); + if (info) + gtk_tree_view_column_clear_attributes_by_info (column, info); } static void