From fbf80ae696ba12be2634ee52975fffcf38a27ee5 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 6 Jul 2004 12:00:53 +0000 Subject: [PATCH] fix spider memleaks #137863 Original commit message from CVS: fix spider memleaks #137863 --- ChangeLog | 8 ++++++++ gst/autoplug/gstspider.c | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 477f843acc..2c99b1539e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-07-06 Thomas Vander Stichele + + patch by: Sebastien Cote + + * gst/autoplug/gstspider.c: (gst_spider_init), + (gst_spider_dispose): + fix spider memleaks. fixes #137863 + 2004-07-06 Thomas Vander Stichele patch by: Joe Marcus Clarke diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index cc7731917e..0ceedf874f 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -182,8 +182,10 @@ gst_spider_init (GstSpider * spider) { /* use only elements which have sources and sinks and where the sinks have caps */ /* FIXME: How do we handle factories that are added after the spider was constructed? */ - spider->factories = gst_autoplug_factories_filters_with_sink_caps ((GList *) - gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY)); + GList *list = gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY); + + spider->factories = gst_autoplug_factories_filters_with_sink_caps (list); + g_list_free (list); spider->links = NULL; @@ -198,11 +200,21 @@ static void gst_spider_dispose (GObject * object) { GstSpider *spider; + GList *list; spider = GST_SPIDER (object); g_list_free (spider->factories); spider->factories = NULL; + for (list = spider->links; list; list = list->next) { + GstSpiderConnection *conn = list->data; + + g_list_free (conn->path); + g_free (conn); + } + g_list_free (spider->links); + spider->links = NULL; + ((GObjectClass *) parent_class)->dispose (object); } static GstPad *