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 512826 - switch / selector event leak
switch / selector event leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-29 16:07 UTC by Laurent Glayal
Modified: 2008-02-01 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurent Glayal 2008-01-29 16:07:00 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.
Comment 1 Aurelien Grimaud 2008-01-30 12:41:55 UTC
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.
Comment 2 Wim Taymans 2008-02-01 16:58:40 UTC
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().
Comment 3 Wim Taymans 2008-02-01 17:08:17 UTC
        * gst/selector/gstinputselector.c: (gst_selector_pad_event):
        Don't leak event on pads that are not linked. Fixes #512826.
Comment 4 Aurelien Grimaud 2008-02-01 20:12:18 UTC
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 ?