GNOME Bugzilla – Bug 324818
gst_registry_get_default doesn't sink newly created registry
Last modified: 2006-02-14 16:18:45 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.
Created attachment 56305 [details] [review] Ref and sink the new registry
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), (_gst_registry_cleanup): Protect default registry with lock and ref/sink it. Fixes #324818, patch by Torsten Schoenfeld.