summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Verhelst <w@uter.be>2016-03-31 11:09:41 +0200
committerMatthias Clasen <mclasen@redhat.com>2016-04-19 10:22:00 -0400
commit139cb2a51021f766337b2283263aa976a3f2f145 (patch)
tree9c5b97dbf6661cbfa963d559b5687bec99a54cf1
parenta2a369ae1c9b393297fed6bbdb181a9189714e62 (diff)
downloadgtk+-139cb2a51021f766337b2283263aa976a3f2f145.tar.gz
Clarify that one cannot use the same variable
A naive way to perform an action on all parent nodes of a given node could be to do: while(gtk_tree_model_iter_parent(model, &iter, &iter)) { /* perform some action on iter here */ } However, since gtk_tree_model_iter_parent() will initialize the iterator pointed to by the second parameter before performing the lookup, this will not work. Explicitly document this behaviour. Signed-off-by: Wouter Verhelst <w@uter.be> https://bugzilla.gnome.org/show_bug.cgi?id=573380
-rw-r--r--gtk/gtktreemodel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c
index 5e447b9a2e..500658b5c1 100644
--- a/gtk/gtktreemodel.c
+++ b/gtk/gtktreemodel.c
@@ -1640,6 +1640,9 @@ gtk_tree_model_iter_nth_child (GtkTreeModel *tree_model,
* @child will remain a valid node after this function has been
* called.
*
+ * @iter will be initialized before the lookup is performed, so @child
+ * and @iter cannot point to the same memory location.
+ *
* Returns: %TRUE, if @iter is set to the parent of @child
*/
gboolean