GNOME Bugzilla – Bug 786060
Sequences documentation does not make it clear who takes ownership of returned pointers
Last modified: 2017-08-10 15:39:14 UTC
I could not figure out, from https://developer.gnome.org/glib/stable/glib-Sequences.html, whether the caller is supposed to do anything about freeing memory related to the pointers returned by g_sequence_lookup or not. From #gtk+: 17:54 <rbasak> Do functions like g_sequence_lookup_iter require the pointers they returned to be freed? I don't see anything documented at https://developer.gnome.org/glib/stable/glib-Sequences.html, nor any free functions, but I don't see how state can be stored in any other way. 17:55 <rbasak> Is there some higher level documentation on memory management I'm missing here? 18:01 <@ebassi> rbasak: The API reference should make it clear whether or not the returned value ownership is transfered to the caller or not 18:01 <@ebassi> rbasak: If it doesn't, please: file a bug 18:03 <@ebassi> (In this specific case, the iterator is owned by the GSequence so you should not free it) 18:15 <rbasak> ebassi: OK. Thanks!
Created attachment 357336 [details] [review] gsequence: Add introspection annotations to Return values Signed-off-by: Philip Withnall <withnall@endlessm.com>
Review of attachment 357336 [details] [review]: Looks good.
Attachment 357336 [details] pushed as fac7f2b - gsequence: Add introspection annotations to Return values