[Bug 702960] gst_element_add_pad()'s pad parameter should be marked as transfer none

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Jul 26 02:33:54 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=702960
  GStreamer | gstreamer (core) | git

--- Comment #13 from Simon Feltman <s.feltman at gmail.com> 2013-07-26 09:33:51 UTC ---
(In reply to comment #12)
> It doesn't really, ref_sink() "steals" a reference if the object was floating,
> and otherwise "adds its own ref". It's something in between both cases.

Agreed, but that can be relegated to an implementation detail only important to
binding layers and the g_object_new function (which is always transfer full but
may randomly return a floating object). Whether or not an argument to a
function is floating, should be controlled by what the caller wants to do. If
the caller wants to keep its own ref, it does its own ref_sink and the API
function it is calling will add an additional ref, if it has a floating ref and
wants to give it away, it passes it on. In either case, the callee should be
guaranteed ownership of a reference without leaking when it uses
g_object_ref_sink with the argument annotated as (transfer none). This is true
at least in the Python and Gjs bindings, but I have no idea how vala deals with
things from the perspective of the caller.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list