GNOME Bugzilla – Bug 731768
gstsrtpenc: unref event when needed
Last modified: 2014-06-18 14:08:55 UTC
Event must be unreferenced if it is not forwarded.
Created attachment 278580 [details] [review] A patch to solve the issue
The unref is indeed needed but *after* using the event inside it, pushed a modified patch: commit bf003caf9d75d05aed9cfefda3cde025520edc89 Author: Miguel París Díaz <mparisdiaz@gmail.com> Date: Tue Jun 17 11:48:12 2014 +0200 gstsrtpenc: unref event when needed Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731768
Comment on attachment 278580 [details] [review] A patch to solve the issue unref needs to be after setcaps
At the beginning, I did it as you say, but I changed it because gst_event_parse_caps (event, &caps) gives to the caps var the ownership of the caps ref.
(In reply to comment #4) > At the beginning, I did it as you say, but I changed it because > gst_event_parse_caps (event, &caps) gives to the caps var the ownership of the > caps ref. It does not, the ref to the caps only remains valid for as long as the event is alive. If you would get an additional ref to the caps, the caps would be leaked in the set_caps function then.
OK, you are right.
Created attachment 278684 [details] [review] A patch to solve the bug