Web lists-archives.com

Re: g_object_add_toggle_ref

On Sun, 2017-06-25 at 10:59 +0100, Emmanuele Bassi wrote:
> I very much doubt anybody here has knowledge of toggle reference and
> language bindings.

Yes, I guess that is true, the original authors seems all to be
retired. For IRC or devel list, I fear situation is not really better,
and I do not really want to make noise there, the few remaining
developers may have to do more important stuff.

> All GC language bindings will immediately sink the floating reference,
> as it makes memory management harder for them (it's a C feature, after
> all). So my suggestion is to immediately and automatically sink the
> floating reference inside your wrapper around g_object_new() before it
> returns the instance to the non-C side.

That is an interesting hint. Indeed I did that in my first draft about
a year ago, before I discovered  g_object_add_toggle_ref() function. Of
course it makes sense to use it in combination.

At least basically my Nim wrapper is working already -- maybe for
details I will have to look at wrappers for other languages. Maybe I
should consider contacting the Rust developers, as Rust is also a
compiled language, and they have some GTK bindings. 
gtk-list mailing list