GNOME Bugzilla – Bug 528245
rtpbin element leaks
Last modified: 2008-04-22 08:22:09 UTC
g_signal_emitv() requires the passed in GValues to be cleared with g_value_unset after usage.
Created attachment 109313 [details] [review] patch to fix some leaks This patch - unsets the GValues used for emitv - unref a leaked pad name
* gst/rtpmanager/gstrtpbin.c: (get_pt_map), (free_client), (gst_rtp_bin_associate), (gst_rtp_bin_get_free_pad_name): * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_rtp_jitter_buffer_get_clock_rate): * gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_get_caps): * gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_clock_rate): Unset GValues after g_signal_emitv so that we avoid a refcount leak. Don't leak a padname. Don't leak client streams list. Lock rtpbin when associating streams. Fixes #528245.
Created attachment 109460 [details] [review] patch for one more leak This fixes a leak of a ref to the jb.
It still leaks (re-using bug).. I'll try to run my farsight2 tests through valgrind again to see if I can still see any leaks.
Created attachment 109504 [details] [review] More leak fixes With this patch, I can run all of the farsight2 unit tests in valgrind without detecting leaks related to rtpmanager.
Wim, if this patch is ok for you, put it in
I get some caps problems with rtspsrc with this and I need more time to test.
This was causing problems in rtspsrc: * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init), (request_pt_map), (gst_rtspsrc_configure_caps): Ref caps as the return value for the request_pt_map signal. Remove some caps weirdness when configuring a stream. See #528245.
Patch by: Olivier Crete <tester at tester dot ca> * gst/rtpmanager/gstrtpbin.c: (create_session), (get_pt_map), (new_ssrc_pad_found): Ref caps when inserting into the cache. Don't leak pads. * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_rtp_jitter_buffer_get_clock_rate), (gst_rtp_jitter_buffer_query): Avoid a caps leak. Don't leak refcount in query. * gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_get_caps), (gst_rtp_pt_demux_chain): Avoid caps leaks. * gst/rtpmanager/gstrtpsession.c: (source_get_sdes_structure), (gst_rtp_session_init), (return_true), (gst_rtp_session_clear_pt_map), (gst_rtp_session_cache_caps), (gst_rtp_session_clock_rate): Ref caps when inserting into the cache. Fix some more caps leaks. Fixes #528245.
This one is also needed (same code as rtspsrc) * gst/sdp/gstsdpdemux.c: (request_pt_map): Ref caps, see #528245.