From 5cb557dbf5308ea9f492dce6a41179ce394e9c6e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 14 May 2001 21:22:52 +0000 Subject: [PATCH] fixed a mem leak in the destroy code. Original commit message from CVS: fixed a mem leak in the destroy code. --- gst/gstelement.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index bba7a264a2..2abd1f0c3e 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -905,13 +905,14 @@ gst_element_real_destroy (GtkObject *object) GST_DEBUG_ELEMENT (GST_CAT_REFCOUNTING, element, "destroy\n"); if (element->pads) { - pads = g_list_copy (element->pads); + GList *orig; + orig = pads = g_list_copy (element->pads); while (pads) { pad = GST_PAD (pads->data); gst_object_unparent (GST_OBJECT (pad)); pads = g_list_next (pads); } - g_list_free (pads); + g_list_free (orig); } g_list_free (element->pads);