GNOME Bugzilla – Bug 738291
fluiddec: leaks incoming caps event
Last modified: 2014-10-25 12:15:00 UTC
Created attachment 288211 [details] memleak after gst_event_new_caps() Hi, running the following pipeline under valgrind I get some "definitely lost" blocks: wget -nc http://www.midishrine.com/midipp/nes/Super_Mario_Bros/smb1-1up.mid gst-launch-1.0 filesrc location=smb1-1up.mid ! midiparse ! fluiddec ! fakesink Full log attached, it contains the exact valgrind command line. My current guess is that a new event is created in gst_event_new_caps() but there is some missing call to gst_event_unref() somewhere, maybe in gstreamer/gst/gstpad.c in the push_buffer_* functions? I don't know the GStreamer internals well enough to figure it out myself, I'd appreciate if someone more familiar with the code could take a look. Thanks, Antonio
commit 39a5c202636d319b18cdd27d27f9dd06e8d9ca97 Author: Tim-Philipp Müller <tim@centricular.com> Date: Fri Oct 10 13:05:49 2014 +0100 fluiddec: don't leak incoming caps event https://bugzilla.gnome.org/show_bug.cgi?id=738291
Thanks. Just to be sure, we are deincrementing the refcount of the _unused_ event parameter here, right? While the one created in the call below will be unreferenced by GStreamer in the push callbacks instead: res = gst_pad_push_event (fluiddec->srcpad, gst_event_new_caps (caps)); ^^^ Is that correct? Ciao, Antonio
pad_push() and pad_push_event() takes ownership of the buffer/event, meaning the next element takes ownership and is responsible for either unreffing it or passing it on.