From d8f572647fe1ee56d4e4a0a215626339a40890fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 13 Mar 2015 15:31:30 +0000 Subject: [PATCH] bus: Use g_list_free_full() instead of manually unreffing and freeing Also unref the messages, not the GList nodes. --- gst/gstbus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gst/gstbus.c b/gst/gstbus.c index a1a008e0b3..7865079b05 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -446,7 +446,7 @@ void gst_bus_set_flushing (GstBus * bus, gboolean flushing) { GstMessage *message; - GList *l, *message_list = NULL; + GList *message_list = NULL; GST_OBJECT_LOCK (bus); @@ -464,11 +464,7 @@ gst_bus_set_flushing (GstBus * bus, gboolean flushing) GST_OBJECT_UNLOCK (bus); - for (l = message_list; l; l = l->next) { - message = GST_MESSAGE (l); - gst_message_unref (message); - } - g_list_free (message_list); + g_list_free_full (message_list, (GDestroyNotify) gst_message_unref); } /** -- 2.34.1