After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 324818 - gst_registry_get_default doesn't sink newly created registry
gst_registry_get_default doesn't sink newly created registry
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
Other Linux
: Normal normal
: 0.10.4
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Reported: 2005-12-22 16:01 UTC by Torsten Schoenfeld
Modified: 2006-02-14 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---

Ref and sink the new registry (625 bytes, patch)
2005-12-22 16:01 UTC, Torsten Schoenfeld
none Details | Review

Description Torsten Schoenfeld 2005-12-22 16:01:03 UTC
When gst_registry_get_default finds that there's no global default registry yet, it creates a new one via g_object_new.  Since GstRegistry is a GstObject, it inherits the floating reference semantics.  I use those semantics in the Perl bindings to get memory management right without having to worry whether or not I own the returned object.  In the case of gst_registry_get_default, this breaks though, since gst_registry_get_default doesn't sink the created registry.

I attach a patch (against HEAD) that changes gst_registry_get_default to ref and sink the new registry.
Comment 1 Torsten Schoenfeld 2005-12-22 16:01:38 UTC
Created attachment 56305 [details] [review]
Ref and sink the new registry
Comment 2 Wim Taymans 2006-02-14 16:18:23 UTC
commited a slightly changed version that also does proper locking along with the _ref/_sink pair of calls:

        * gst/gstregistry.c: (gst_registry_get_default),
        Protect default registry with lock and ref/sink it.
        Fixes #324818, patch by Torsten Schoenfeld.