diff options
author | Richard Hughes <richard@hughsie.com> | 2014-10-15 11:24:44 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-10-15 13:44:19 +0100 |
commit | 422f4525e8b375ed55b5a8f4b7a35e2421482059 (patch) | |
tree | 5371e115c55cf451e4e92066255283be756cd2bd /libappstream-builder/asb-task.c | |
parent | e460b61d53474f411ec3f1ab572be04c98460d85 (diff) | |
download | appstream-glib-422f4525e8b375ed55b5a8f4b7a35e2421482059.tar.gz |
Do not leak applications when building if more than one plugin returns results
Diffstat (limited to 'libappstream-builder/asb-task.c')
-rw-r--r-- | libappstream-builder/asb-task.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libappstream-builder/asb-task.c b/libappstream-builder/asb-task.c index ea56efc..7676d63 100644 --- a/libappstream-builder/asb-task.c +++ b/libappstream-builder/asb-task.c @@ -299,20 +299,26 @@ asb_task_process (AsbTask *task, GError **error_not_used) /* run plugins */ asb_panel_set_status (priv->panel, "Examining"); for (i = 0; i < priv->plugins_to_run->len; i++) { + GList *apps_tmp = NULL; plugin = g_ptr_array_index (priv->plugins_to_run, i); asb_package_log (priv->pkg, ASB_PACKAGE_LOG_LEVEL_DEBUG, "Processing %s with %s", basename, plugin->name); - apps = asb_plugin_process (plugin, priv->pkg, priv->tmpdir, &error); - if (apps == NULL) { + apps_tmp = asb_plugin_process (plugin, priv->pkg, priv->tmpdir, &error); + if (apps_tmp == NULL) { asb_package_log (priv->pkg, ASB_PACKAGE_LOG_LEVEL_WARNING, "Failed to run process '%s': %s", plugin->name, error->message); g_clear_error (&error); } + for (l = apps_tmp; l != NULL; l = l->next) { + app = ASB_APP (l->data); + asb_plugin_add_app (&apps, AS_APP (app)); + } + g_list_free_full (apps_tmp, g_object_unref); } if (apps == NULL) goto skip; |