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 557710 - Memory leak related to matroskamux's request pads
Memory leak related to matroskamux's request pads
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.14
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-24 07:47 UTC by Peter Kjellerstedt
Modified: 2009-01-23 08:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix two request pad releated problems in matroskamux (1.77 KB, patch)
2008-10-24 07:48 UTC, Peter Kjellerstedt
committed Details | Review

Description Peter Kjellerstedt 2008-10-24 07:47:50 UTC
I found two problems related to the request pads used by the matroskamux element.

The first problem is that if you create a matroskamux element and add it to a pipeline, but never set the pipeline to playing, gst_matroska_pad_free() is never called and we leak memory. This can be fixed by using gst_collect_pads_add_pad_full() instead of gst_collect_pads_add_pad() and specifying gst_matroska_pad_free() as the destroy notifier.

The second problem is if one actually tries to do the right thing and call gst_element_release_request_pad() on the requested pad from matroskamux. Then this will fail with a warning about an unknown pad. This is because the code in gst_matroska_mux_release_pad() only works for pads which currently have collected data (which of course will not happen if the pipeline hasn't been running...)
gst_matroska_mux_release_pad() should always call gst_collect_pads_remove_pad() and gst_element_remove_pad() for all pads, regardless of whether they've collected any data or not.

The attached patch should fix both of the problems described above.
Comment 1 Peter Kjellerstedt 2008-10-24 07:48:47 UTC
Created attachment 121248 [details] [review]
Fix two request pad releated problems in matroskamux
Comment 2 Sebastian Dröge (slomo) 2008-10-27 08:44:58 UTC
2008-10-27  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

	Patch by: Peter Kjellerstedt <pkj at axis com>

	* gst/matroska/matroska-mux.c: (gst_matroska_mux_reset),
	(gst_matroska_mux_request_new_pad), (gst_matroska_mux_release_pad):
	Fix a memory leak when pads are requested but the pipeline never
	goes into PLAYING.

	Correctly remove request pads, no matter if they have collected
	data or not.

	Fixes bug #557710.