GNOME Bugzilla – Bug 94464
[threads] gst_scheduler_add_scheduler() doesn't ref passed scheduler
Last modified: 2005-01-31 15:43:27 UTC
gst_scheduler_add_scheduler() doesn't ref the passed GstScheduler which makes life hard for people who want to write a wrapper and will lead to inconsistencies in Gstreamer.
fixed in CVS
Hm, it seems like you added a circular reference in gst_scheduler_add_scheduler(GstScheduler *sched, GstScheduler *sched2). In current cvs the affected lines read: gst_object_ref (GST_OBJECT (sched2)); gst_object_ref (GST_OBJECT (sched)); Did you do this on purpose? The second line seems superfluous.
gst_scheduler_dispose() would need to set "parent_sched" of all schedulers in the list "schedulers" to NULL and unreference them, then. Would it be dangerous to clear the "parent_sched" field?
david, any idea what we can do with this ?
david, wim, ping
The circular reference is ok. The dispose method of the parent scheduler should indeed deref all of the child schedulers, which is a bug. The refcounting policies for these kind of objects is not very well defined or documented though.
Created attachment 36686 [details] [review] proposed fix Patch doing what Wim says (dereference all contained schedulers on dispose). Please review.
Applied.