GNOME Bugzilla – Bug 109808
[threads] gst_scheduler_factory_create() doesn't reference the passed element
Last modified: 2005-01-29 17:07:23 UTC
gst_scheduler_factory_create() uses: GST_ELEMENT_SCHED (parent) = sched; to set the scheduler of the passed element. I think it should use: gst_element_set_scheduler(sched) instead so that sched "gets" referenced by the "parent" element. Or should it read: gst_scheduler_add_element(sched, parent) ? I can commit the fix myself. Just let me know.
On the other hand, "parent" probably can't be referenced. (Otherwise we would get a circular reference.) So "parent" must be set to NULL when the "parent" element is destroyed. This would have to be done from gst_element_dispose() or from gst_scheduler_remove_element().
Wim, what is your opinion on this?
david, any ideas ?
wim, david, ping ?
The parent of the scheduler is the object owning the scheduler, a manager bin like a thread or a pipeline. After adding elements to the manager bin, the scheduler is set to the element, using GST_ELEMENT_SCHED(), and the element is added to the scheduler using gst_scheduler_add_element(). Policies for these operations is not very well defined though.
So all this is already done in the code. That means that the bug is long-fixed already? This is crystal-clear to me: the parent element (thread, pipeline) holds a reference to the scheduler, the *only* reference. The scheduler is owned by that element, and destroyed as the element is destroyed (which happens in gst_element_dispose). This is all already done. The parent is obviously not referenced because circular references mean the object never gets destroyed. Besides, the scheduler never exists without its parent (since the parent holds reference) so that's no issue. Doesn't that meant he bug is fixed? Please reopen if this is wrong. Marking as INVALID for now. (Yes, I'm cleaning up bugzilla.)