From e6615bfc3b45e50969f793db6f1b550b6c1208f6 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 23 Aug 2005 20:33:42 +0000 Subject: [PATCH] don't bother inserting new rows in a level with a zero refcount and 2005-08-23 Kristian Rietveld * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): don't bother inserting new rows in a level with a zero refcount and immediately free the level. (Fixes #312350, reported by Markku Vire). --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtktreemodelsort.c | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 929e92f4ba..2581077c91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-23 Kristian Rietveld + + * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): don't + bother inserting new rows in a level with a zero refcount and + immediately free the level. (Fixes #312350, reported by Markku Vire). + 2005-08-23 Matthias Clasen * gtk/updateiconcache.c: Complain when there is no index.theme file diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 929e92f4ba..2581077c91 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-08-23 Kristian Rietveld + + * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): don't + bother inserting new rows in a level with a zero refcount and + immediately free the level. (Fixes #312350, reported by Markku Vire). + 2005-08-23 Matthias Clasen * gtk/updateiconcache.c: Complain when there is no index.theme file diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 929e92f4ba..2581077c91 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-08-23 Kristian Rietveld + + * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): don't + bother inserting new rows in a level with a zero refcount and + immediately free the level. (Fixes #312350, reported by Markku Vire). + 2005-08-23 Matthias Clasen * gtk/updateiconcache.c: Complain when there is no index.theme file diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c index 47b42b66b1..ed15794217 100644 --- a/gtk/gtktreemodelsort.c +++ b/gtk/gtktreemodelsort.c @@ -728,6 +728,12 @@ gtk_tree_model_sort_row_inserted (GtkTreeModel *s_model, if (!parent_level) goto done; + if (level->ref_count == 0 && level != tree_model_sort->root) + { + gtk_tree_model_sort_free_level (tree_model_sort, level); + goto done; + } + if (!gtk_tree_model_sort_insert_value (tree_model_sort, parent_level, s_path,