summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-03-13 15:31:30 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-04-23 12:02:02 +0100
commita9598175eea96df62ffc41692824b1ca61151c5f (patch)
tree70846f3ba6b07615ea48547b038e5912dcc03410
parent432f8f392a5ae63c35840d52c82e5694c2e7bf50 (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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gst/gstbus.c b/gst/gstbus.c
index 7f99d5740d..c85212b389 100644
--- a/gst/gstbus.c
+++ b/gst/gstbus.c
@@ -435,7 +435,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);
@@ -453,11 +453,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);
}
/**