From 38bc98350207675b054dfa2a5b999618a6d7f90c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 29 Dec 2012 17:54:51 -0300 Subject: [PATCH] asset: Fix some leaks --- ges/ges-asset.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ges/ges-asset.c b/ges/ges-asset.c index 7f5a3e4d4b..fcf9130aff 100644 --- a/ges/ges-asset.c +++ b/ges/ges-asset.c @@ -346,6 +346,9 @@ ges_asset_finalize (GObject * object) if (priv->proxied_asset_id) g_free (priv->proxied_asset_id); + if (priv->error) + g_error_free (priv->error); + G_OBJECT_CLASS (ges_asset_parent_class)->finalize (object); } @@ -484,6 +487,8 @@ ges_asset_cache_set_loaded (GType extractable_type, const gchar * id, GList *results = entry->results; asset->priv->state = ASSET_INITIALIZED_WITH_ERROR; + if (asset->priv->error) + g_error_free (asset->priv->error); asset->priv->error = g_error_copy (error); entry->results = NULL; UNLOCK_CACHE; @@ -494,6 +499,7 @@ ges_asset_cache_set_loaded (GType extractable_type, const gchar * id, g_simple_async_result_set_from_error (G_SIMPLE_ASYNC_RESULT (tmp->data), error); g_simple_async_result_complete (G_SIMPLE_ASYNC_RESULT (tmp->data)); + gst_object_unref (tmp->data); } g_list_free (results); @@ -501,8 +507,9 @@ ges_asset_cache_set_loaded (GType extractable_type, const gchar * id, } else { asset->priv->state = ASSET_INITIALIZED; - g_list_free_full (entry->results, - (GDestroyNotify) g_simple_async_result_complete_in_idle); + g_list_foreach (entry->results, + (GFunc) g_simple_async_result_complete_in_idle, NULL); + g_list_free_full (entry->results, g_object_unref); entry->results = NULL; UNLOCK_CACHE; }