[gtk+] gtktreeviewaccessible: do not trigger an assertion
- From: Alban Crequy <albanc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtktreeviewaccessible: do not trigger an assertion
- Date: Fri, 23 Sep 2011 16:07:10 +0000 (UTC)
commit 6ab7b87a02b5eb1af2703dc3f151442b2cf4ce9a
Author: Alban Crequy <alban crequy collabora co uk>
Date: Thu Sep 22 16:39:06 2011 -0400
gtktreeviewaccessible: do not trigger an assertion
The following assertion was triggered in model_row_inserted() because
iterate_thru_children() modifies the parameter tree_model before passing it to
traverse_cells().
Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth > 0' failed
The stack with the bug was:
#0 gtk_tree_path_compare at gtktreemodel.c
#1 traverse_cells at gtktreeviewaccessible.c
#2 model_row_inserted at gtktreeviewaccessible.c
This patch calls iterate_thru_children() with a copy of the path so that the
original is not modified.
gtk/a11y/gtktreeviewaccessible.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index 5abcb66..616ce5a 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -2109,13 +2109,18 @@ model_row_inserted (GtkTreeModel *tree_model,
/* Figure out number of visible children. */
if (gtk_tree_model_iter_has_child (tree_model, &tmp_iter))
{
+ GtkTreePath *path2;
/*
* By passing path into this function, we find the number of
* visible children of path.
*/
n_inserted = 0;
+ /* iterate_thru_children modifies path, we don't want that, so give
+ * it a copy */
+ path2 = gtk_tree_path_copy (path);
iterate_thru_children (tree_view, tree_model,
- path, NULL, &n_inserted, 0);
+ path2, NULL, &n_inserted, 0);
+ gtk_tree_path_free (path2);
/* Must add one to include the row that is being added */
n_inserted++;
@@ -2620,6 +2625,7 @@ set_iter_nth_row (GtkTreeView *tree_view,
*
* *count will be set to the visible row number of the child
* relative to the row that was initially passed in as tree_path.
+ * tree_path could be modified by this function.
*
* *count will be -1 if orig is not found as a child (a row that is
* not visible will not be found, e.g. if the row is inside a
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]