On Sat, 2017-09-09 at 21:46 +0000, Emmanuele Bassi wrote:
> Boxed types use g_boxed_free() to release resources, and
> g_boxed_copy() to copy them:
> https://developer.gnome.org/gobject/stable/gobject-Boxed-Types.html
>
> Ciao,
> Emmanuele.
Yes I know :-)
But from
https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-new
PangoFontDescription is a boxed type (from Object Hierarchy), and we
shall use pango_font_description_free() for freeing.
Do you suggest just using g_boxed_free() instead?
If you're writing a language binding, you should use the GBoxed API for all boxed types, as that defers to the correct function without having to make up an annotation for copy and free functions.
As for Pango: introspection annotations may be missing or wrong; Pango is not heavily used on its own, and most definitely only a subset of its API is heavily exercised outside of GTK. In case of uncertainty, file bugs.
Ciao,
Emmanuele.