diff options
author | Thomas Holder <thomas@thomas-holder.de> | 2020-09-22 09:27:29 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-09-23 07:53:33 -0400 |
commit | 4325c200137f4391cff24398251f37b255387ae3 (patch) | |
tree | 06c3abf23801bfdc55292c5271b68fcaab4b1ee3 /gtk/gtktreeview.c | |
parent | 5e4180b5f08294e7c28b716102bb6eef6e356ae0 (diff) | |
download | gtk+-4325c200137f4391cff24398251f37b255387ae3.tar.gz |
gtktreeview: Fix child access after TEST_EXPAND_ROW
In gtk_tree_view_build_tree with recurse=TRUE, the TEST_EXPAND_ROW
signal might invalidate the child iterator. Getting the iterator after
the signal (instead of before) fixes the issue.
Fixes https://gitlab.com/inkscape/inkscape/-/issues/1879
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r-- | gtk/gtktreeview.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index e9f6c12327..315360c683 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -8616,13 +8616,13 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view, else gtk_tree_path_next (path); - if (gtk_tree_model_iter_children (priv->model, &child, iter)) + if (gtk_tree_model_iter_has_child (priv->model, iter)) { gboolean expand; g_signal_emit (tree_view, tree_view_signals[TEST_EXPAND_ROW], 0, iter, path, &expand); - if (gtk_tree_model_iter_has_child (priv->model, iter) + if (gtk_tree_model_iter_children (priv->model, &child, iter) && !expand) { temp->children = gtk_tree_rbtree_new (); |