Which transfer to use with a GPtrArray (original) (raw)

I’m returning a GPtrArray in a function, and I’m not sure which transfer do I have to put in introspection data. The GPtrArray is created with g_ptr_array_new_full, thus calling g_ptr_array_unref in the last reference will free the GPtrArray and all its elements. Also, I’m returning it after doing a g_ptr_array_ref. I presume that the answer is “full”, but just to be sure.

ebassi (Emmanuele Bassi) April 4, 2024, 11:37am 2

Don’t: Writing Bindable APIs — GObject Introspection

Also: halting problem : Writing Bindable API, 2023 Edition

Use GPtrArray as an array builder, and then turn its contents into a C array at the API boundary.

system (system) Closed May 4, 2024, 11:38am 3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.