element: unref message in _post_message when there is no implementation

'gst_element_post_message' takes the ownership of the message, so it
shall unref it when there is no post_message implementation. Otherwise
message is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=759300
This commit is contained in:
Aurélien Zanelli 2015-12-10 14:32:27 +01:00 committed by Sebastian Dröge
parent b427997119
commit 51a70dd586

View file

@ -1743,6 +1743,8 @@ gst_element_post_message (GstElement * element, GstMessage * message)
klass = GST_ELEMENT_GET_CLASS (element);
if (klass->post_message)
res = klass->post_message (element, message);
else
gst_message_unref (message);
GST_TRACER_ELEMENT_POST_MESSAGE_POST (element, res);
return res;