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 168493 - [API] gst_index_factory_new() doesn't increase refcount of existing factory
[API] gst_index_factory_new() doesn't increase refcount of existing factory
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.8.9
Other Linux
: Normal normal
: 0.8.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-02-25 11:27 UTC by Torsten Schoenfeld
Modified: 2005-03-12 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Torsten Schoenfeld 2005-02-25 11:27:51 UTC
If gst_index_factory_new() finds a factory via gst_index_factory_find(), it
simply  returns it without increasing its refcount.  Usually, constructors
return a new object, so the receiver can always assume ownership without
manually increasing the refcount himself.  In this case, the receiver can't be
sure if he really owns the factory, which leads to either segfaults or leaks.

This is especially visible in language bindings which need to be very careful
about refcounts to avoid having dangling pointers all over the place.
Comment 1 Ronald Bultje 2005-03-11 21:00:59 UTC
Fixed.
Comment 2 Torsten Schoenfeld 2005-03-12 18:20:56 UTC
You used gst_object_ref (GST_OBJECT (factory)) in the change, but
GstIndexFactory is no GstObject.  It's a GstPluginFeature which in turn is a
GObject.
Comment 3 Ronald Bultje 2005-03-12 20:07:13 UTC
Oops, I'm very sorry. Fixed again.