diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-03-13 15:31:30 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-03-13 15:31:30 +0000 |
commit | d8f572647fe1ee56d4e4a0a215626339a40890fa (patch) | |
tree | c22eeb1b39886c5b696d6a587b89adfa7f3be8e8 | |
parent | f50d809c2548a3d2e067be81a94b96f4b6923f58 (diff) |
bus: Use g_list_free_full() instead of manually unreffing and freeing
Also unref the messages, not the GList nodes.
-rw-r--r-- | gst/gstbus.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gst/gstbus.c b/gst/gstbus.c index a1a008e0b..7865079b0 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); } /** |