From 873e9ce4b8a4749827ee40bbcad75db21dec8618 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Fri, 26 Apr 2002 19:55:14 +0000 Subject: [PATCH] if the deleted node was "below" this path, then do not unref all nodes Fri Apr 26 21:58:16 2002 Kristian Rietveld * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the deleted node was "below" this path, then do not unref all nodes between the deleted parent and the node this rowref is pointing too (see added comment in gtk_tree_row_ref_deleted_callback), (fixes #77977) --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtktreemodel.c | 9 ++++++++- 7 files changed, 56 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0e22e265ce..5c01883f99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Fri Apr 26 21:58:16 2002 Kristian Rietveld + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the + deleted node was "below" this path, then do not unref all nodes + between the deleted parent and the node this rowref is pointing too + (see added comment in gtk_tree_row_ref_deleted_callback), + (fixes #77977) + 2002-04-26 Sven Neumann * tests/testtreecolumns.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0e22e265ce..5c01883f99 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Fri Apr 26 21:58:16 2002 Kristian Rietveld + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the + deleted node was "below" this path, then do not unref all nodes + between the deleted parent and the node this rowref is pointing too + (see added comment in gtk_tree_row_ref_deleted_callback), + (fixes #77977) + 2002-04-26 Sven Neumann * tests/testtreecolumns.c diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0e22e265ce..5c01883f99 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Fri Apr 26 21:58:16 2002 Kristian Rietveld + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the + deleted node was "below" this path, then do not unref all nodes + between the deleted parent and the node this rowref is pointing too + (see added comment in gtk_tree_row_ref_deleted_callback), + (fixes #77977) + 2002-04-26 Sven Neumann * tests/testtreecolumns.c diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0e22e265ce..5c01883f99 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Fri Apr 26 21:58:16 2002 Kristian Rietveld + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the + deleted node was "below" this path, then do not unref all nodes + between the deleted parent and the node this rowref is pointing too + (see added comment in gtk_tree_row_ref_deleted_callback), + (fixes #77977) + 2002-04-26 Sven Neumann * tests/testtreecolumns.c diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0e22e265ce..5c01883f99 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Fri Apr 26 21:58:16 2002 Kristian Rietveld + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the + deleted node was "below" this path, then do not unref all nodes + between the deleted parent and the node this rowref is pointing too + (see added comment in gtk_tree_row_ref_deleted_callback), + (fixes #77977) + 2002-04-26 Sven Neumann * tests/testtreecolumns.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0e22e265ce..5c01883f99 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Fri Apr 26 21:58:16 2002 Kristian Rietveld + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): if the + deleted node was "below" this path, then do not unref all nodes + between the deleted parent and the node this rowref is pointing too + (see added comment in gtk_tree_row_ref_deleted_callback), + (fixes #77977) + 2002-04-26 Sven Neumann * tests/testtreecolumns.c diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 8d66e9d23b..925c4eb77a 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -1368,7 +1368,14 @@ gtk_tree_row_ref_deleted_callback (GObject *object, /* We know it affects us. */ if (path->indices[i] == reference->path->indices[i]) { - gtk_tree_row_reference_unref_path (reference->path, reference->model, reference->path->depth - 1); + if (reference->path->depth > path->depth) + /* some parent was deleted, trying to unref any node + * between the deleted parent and the node the reference + * is pointing to is bad, as those nodes are already gone. + */ + gtk_tree_row_reference_unref_path (reference->path, reference->model, path->depth - 1); + else + gtk_tree_row_reference_unref_path (reference->path, reference->model, reference->path->depth - 1); gtk_tree_path_free (reference->path); reference->path = NULL; }