GHashTable: Explicitly document that _iter_remove() is safe while iterating
authorXavier Claessens <xavier.claessens@collabora.com>
Fri, 21 Feb 2014 20:35:36 +0000 (15:35 -0500)
committerXavier Claessens <xavier.claessens@collabora.com>
Fri, 21 Feb 2014 20:39:31 +0000 (15:39 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=723316

glib/ghash.c

index de05efd..23f4a44 100644 (file)
@@ -809,6 +809,15 @@ iter_remove_or_steal (RealIter *ri, gboolean notify)
  * otherwise you have to make sure that any dynamically allocated
  * values are freed yourself.
  *
+ * It is safe to continue iterating the #GHashTable afterward:
+ * |[
+ * while (g_hash_table_iter_next (&iter, &key, &value))
+ *   {
+ *     if (condition)
+ *       g_hash_table_iter_remove (&iter);
+ *   }
+ * ]|
+ *
  * Since: 2.16
  */
 void