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

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Dec 30 03:55:48 PST 2014


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

--- Comment #23 from Christoph Reiter (lazka) <reiter.christoph at gmail.com> 2014-12-30 11:55:43 UTC ---
Here is a workaround for PyGObject to get rid of the leaks introduced by this
when using gst_bin_add() or gst_element_add_pad():

################################################

def monkeypatch_gst():

    def do_wrap(func):
        def wrap(self, obj):
            result = func(self, obj)
            obj.unref()
            return result
        return wrap

    parent = Gst.Bin()
    elm = Gst.Bin()
    parent.add(elm)
    if elm.__grefcount__ == 3:
        elm.unref()
        Gst.Bin.add = do_wrap(Gst.Bin.add)

    pad = Gst.Pad.new(None, Gst.PadDirection.SRC)
    parent.add_pad(pad)
    if pad.__grefcount__ == 3:
        pad.unref()
        Gst.Element.add_pad = do_wrap(Gst.Element.add_pad)

-- 
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