• Tim-Philipp Müller's avatar
    bus, clock: make sure these never have a floating ref · c0c79188
    Tim-Philipp Müller authored
    Clear the initial floating ref in the init function for
    busses and clocks. These objects can be set on multiple
    elements, so there's no clear parent-child relationship
    here. Ideally we'd just not make them derive from
    GInitiallyUnowned at all, but since we want to keep
    using GstObject features for debugging, we'll just do
    it like this.
    
    This should also fix some problems with bindings, which
    seem to get confused when they get floating refs from
    non-constructor functions (or functions annotated to
    have a 'transfer full' return type). This works now:
    
    from gi.repository import GObject, Gst
    
    GObject.threads_init()
    Gst.init(None)
    
    pipeline=Gst.Pipeline()
    bus = pipeline.get_bus()
    pipeline.set_state(Gst.State.NULL)
    del pipeline;
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679286
    https://bugzilla.gnome.org/show_bug.cgi?id=657202
    c0c79188
gstclock.c 43.9 KB