From 2955eeb0eda1c87fb323368c86ca6456c4da522d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 17 Oct 2015 22:13:08 +0300 Subject: [PATCH] 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 --- gst/gstbin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/gstbin.c b/gst/gstbin.c index 2439b664d4..38c5ec8fba 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -2703,6 +2703,11 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition) goto activate_failure; break; 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 (!(gst_bin_src_pads_activate (bin, FALSE))) goto activate_failure;