summaryrefslogtreecommitdiff
path: root/gtk/gtktreemodel.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2002-04-26 19:55:14 +0000
committerKristian Rietveld <kristian@src.gnome.org>2002-04-26 19:55:14 +0000
commit873e9ce4b8a4749827ee40bbcad75db21dec8618 (patch)
treed55ffd7a06cd16e8b51cb094c702e108ead739ce /gtk/gtktreemodel.c
parentdeb549090a6f85725835494ee47d691295302ec1 (diff)
downloadgtk+-873e9ce4b8a4749827ee40bbcad75db21dec8618.tar.gz
if the deleted node was "below" this path, then do not unref all nodes
Fri Apr 26 21:58:16 2002 Kristian Rietveld <kris@gtk.org> * 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)
Diffstat (limited to 'gtk/gtktreemodel.c')
-rw-r--r--gtk/gtktreemodel.c9
1 files changed, 8 insertions, 1 deletions
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;
}