bin: Make sure to free all cached messages when going to NULL

An ASYNC READY->PAUSED might have failed without the bin code noticing during
the state change, in which case we will never get PAUSED->READY and would leak
messages.

https://bugzilla.gnome.org/show_bug.cgi?id=756611
This commit is contained in:
Sebastian Dröge 2015-10-17 22:13:08 +03:00
parent bc5c199bc5
commit 2955eeb0ed

View file

@ -2703,6 +2703,11 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition)
goto activate_failure; goto activate_failure;
break; break;
case GST_STATE_NULL: case GST_STATE_NULL:
/* Clear message list on next NULL */
GST_OBJECT_LOCK (bin);
GST_DEBUG_OBJECT (element, "clearing all cached messages");
bin_remove_messages (bin, NULL, GST_MESSAGE_ANY);
GST_OBJECT_UNLOCK (bin);
if (current == GST_STATE_READY) { if (current == GST_STATE_READY) {
if (!(gst_bin_src_pads_activate (bin, FALSE))) if (!(gst_bin_src_pads_activate (bin, FALSE)))
goto activate_failure; goto activate_failure;