• Steve Fr茅cinaux's avatar
    Fix wrong refcount when calling introspected widget constructors · 7bc41228
    Steve Fr茅cinaux authored
    Introspected widget constructors, like Gtk.Button.new(), can return
    objects with a floating reference, which was then reffed by pygobject,
    resulting in two references, despite the object is not owned by anyone.
    
    This patch uses ref_sink() when pygobject takes its own reference, to
    avoid adding that extra reference. Hence we now claim ownership on
    objects returned by constructors with transfer=none (which is the case
    for nearly all the widget constructors, despite the floating ref).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640868
    7bc41228
test_everything.py 16.3 KB