Re: Problems with un-owned objects passed to closures in pygobject (gtk_cell_renderer_text_start_editing)
- From: Simon Feltman <s feltman gmail com>
- To: Tristan Van Berkom <tvb gnome org>
- Cc: Torsten Schoenfeld <kaffeetisch gmx de>, gtk-devel-list gnome org
- Subject: Re: Problems with un-owned objects passed to closures in pygobject (gtk_cell_renderer_text_start_editing)
- Date: Tue, 5 Feb 2013 01:32:29 -0800
The side affect of GtkWindow is actually fine in this case because the annotation of "transfer none" for gtk_window_new makes sense here. The function is specifying it returns an internal borrowed reference and Python will add an additional ref during the wrappers lifetime. However, there is trouble when using g_object_new(GTK_TYPE_WINDOW) because it is annotated as "transfer full" which means the constructor is giving us full ownership of that internal reference and without some type of special case, the language binding wrappers will free that internal reference. The cleanest fix would be for gtk_window_new to specify transfer full along with sinking and adding an additional ref before returning, this would at least give consistency between g_object_new(GTK_TYPE_WINDOW) and gtk_window_new in terms of how introspection based bindings see it. But this is most likely out of the question.
Instead it will take some combination of tracking and testing things like: is derived from InitiallyUnowned, is it floating, are we calling a constructor, and what is the ownership transfer. And then try to make a best guess as to what we are supposed to do.
-Simon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]