From: Thibault Saunier Date: Mon, 13 Jul 2015 11:48:40 +0000 (+0200) Subject: assets: Avoid deadlock when done initialising asset X-Git-Tag: 1.19.3~493^2~1156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=724418b75d698786e42f8b464e7ea527e27ff157;p=platform%2Fupstream%2Fgstreamer.git assets: Avoid deadlock when done initialising asset Avoid to hold the CACHE lock when setting the GTasks return values. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=752300 --- diff --git a/ges/ges-asset.c b/ges/ges-asset.c index 603bdc8..b35e8d9 100644 --- a/ges/ges-asset.c +++ b/ges/ges-asset.c @@ -474,7 +474,6 @@ ges_asset_cache_set_loaded (GType extractable_type, const gchar * id, GList *tmp; GESAsset *asset; GESAssetCacheEntry *entry = NULL; - LOCK_CACHE; if ((entry = _lookup_entry (extractable_type, id)) == NULL) { UNLOCK_CACHE; @@ -509,12 +508,15 @@ ges_asset_cache_set_loaded (GType extractable_type, const gchar * id, g_list_free (results); return TRUE; } else { - asset->priv->state = ASSET_INITIALIZED; + GList *results; - g_list_foreach (entry->results, (GFunc) _gtask_return_true, NULL); - g_list_free_full (entry->results, gst_object_unref); + asset->priv->state = ASSET_INITIALIZED; + results = entry->results; entry->results = NULL; UNLOCK_CACHE; + + g_list_foreach (results, (GFunc) _gtask_return_true, NULL); + g_list_free_full (results, gst_object_unref); } return TRUE;