GNOME Bugzilla – Bug 512826
switch / selector event leak
Last modified: 2008-02-01 20:12:18 UTC
Inside switch / selector element, when receiving an event (eg TAG), if current pad is active the event is pushed else nothing, the function returns TRUE . Shouldn't event be unreffed when received on a not active/selected pad ? Regards.
I think so. I think there may be another unref missing. I use switch this way : create switch get_request_pad link set active-pad ... unlink release_request_pad release switch And there is still a reference on the pad. I think it is because active_pad was resetted (=NULL) in gst_*_selector_release_pad and then _dispose will not unref this pad which was active before release. Sould not the active pad be unreffed before setting to NULL ? Regards.
Note that gst_element_get_request_pad() gives a ref to the app that also needs to be unreffed (typically after calling gst_element_release_request_pad().
* gst/selector/gstinputselector.c: (gst_selector_pad_event): Don't leak event on pads that are not linked. Fixes #512826.
So you mean that I need to gst_object_unref my request pad after gst_element_release_request_pad ? This means for the selector : pad = gst_element_get_request_pad ... gst_element_release_request_pad(pad) gst_object_unref(pad) This is not the common behaviour of other elements right ? This works if pad is actually active pad, but if not, there will be an extra unref no ? If so, why not unreffing the pad when gst_input_selector_release_pad is called on active pad ?