garray: Document that return value of g_ptr_array_remove() may be junk
commite6200eaea2b97380162f59555f35d45a1b626ed2
authorPhilip Withnall <withnall@endlessm.com>
Thu, 19 Apr 2018 13:50:35 +0000 (19 14:50 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Wed, 9 May 2018 12:52:05 +0000 (9 13:52 +0100)
tree2ae99edc001961b45583fbf97c467f815091c816
parent2c9a84e5a39fe1e5a392581b95e25c0af830fedf
garray: Document that return value of g_ptr_array_remove() may be junk

If using g_ptr_array_remove*() with a non-NULL GDestroyNotify function,
the value returned will probably be freed memory (depending on what the
GDestroyNotify) function actually does. Warn about that in the
documentation. We can’t just unconditionally return NULL in these cases,
though, since the user might have set the GDestroyNotify to a nifty
function which doesn’t actually free the element; so returning it might
still be valid and useful.

Also add missing (nullable) annotations to that documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=795376
glib/garray.c