[Bug 743062] New: Various GstObject subclasses leak when created by bindings using g_object_new()
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Fri Jan 16 13:13:21 PST 2015
https://bugzilla.gnome.org/show_bug.cgi?id=743062
GStreamer | gstreamer (core) | unspecified
Summary: Various GstObject subclasses leak when created by
bindings using g_object_new()
Classification: Platform
Product: GStreamer
Version: unspecified
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gstreamer (core)
AssignedTo: gstreamer-bugs at lists.freedesktop.org
ReportedBy: reiter.christoph at gmail.com
QAContact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
Various GstObject subclasses leak in bindings (PyGObject, Gjs and Vala) when
created with g_object_new() because they call ref_sink() in "_init" or
"_constructor". The problem is that bindings assume for GInitiallyUnowned
subclasses that they get created floating, and if they happen to be not
floating something has already sunk them and taken ownership. There is no way
for bindings to differentiate between g_object_new(GTK_TYPE_WINDOW, ...) and
g_object_new(GST_TYPE_BUS, ...). They both return a non-floating object and
both inherit from GInitiallyUnowned while in case of GTK_TYPE_WINDOW no
reference is passed to the caller, and in case of GST_TYPE_BUS there is.
The following (introspected) classes are affected:
Gst.Bus
Gst.Task
Gst.TaskPool
Gst.Clock
GstCheck.TestClock
Gst.SystemClock
GstNet.NetClientClock
GstAudio.AudioClock
GstBase.CollectPads
Gst.ControlSource
GstController.LFOControlSource
GstController.TimedValueControlSource
GstController.InterpolationControlSource
GstController.TriggerControlSource
The non-abstract classes define an additional constructor which are correctly
marked "transfer full".
Possible solutions:
1) Remove the ref_sink() in all cases and mark custom constructors
"transfer floating".
2) Remove the ref_sink in all cases and add a ref_sink() to the constructors,
keeping the "transfer full" there.
3) Change nothing and advice binding users to use the class constructors and
set properties after creation. (Gst.Bus.new() instead of Gst.Bus() in
Python)
I can provide a patch if needed.
--
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