Re: Pango library seems to be really hard for gobject-introspection?



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.

On Sat, 9 Sep 2017 at 21:29, Stefan Salewski <mail ssalewski de> wrote:
First I noticed that for pango_font_description_from_string()

>From /usr/share/gir-1.0/Pango-1.0.gir we know that transfer-
ownership="full" so we have to free it in our language bindings.

But how to guess the function for freeing?

For gobject there is generally a plain g_object_unref() necessary, and
there is even g_object_info_get_unref_function () available.

Well PangoFontDescription is Boxed type, does that help?

For all the data types with transfer-ownership="full" there seems to
exist in /usr/share/gir-1.0/Pango-1.0.gir: pango_attribute_destroy(),
pango_attr_list_unref(), pango_attr_iterator_destroy(),
pango_color_free() and more.

Well, my current guess would be to parse all methods of the pango data
types and use the one which contains free or destroy or unref in its
name? But that sounds a bit strange.


_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list
--
https://www.bassi.io
[@] ebassi [@gmail.com]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]