[gnome-software] trivial: Fix object lifecycle issue in the previous refactor
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Fix object lifecycle issue in the previous refactor
- Date: Wed, 10 May 2017 21:09:33 +0000 (UTC)
commit c81a4f6e5da58abae090a35b265c53d1b8b242da
Author: Richard Hughes <richard hughsie com>
Date: Wed May 10 21:56:49 2017 +0100
trivial: Fix object lifecycle issue in the previous refactor
.../gs-plugin-fedora-distro-upgrades.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/fedora-distro-upgrades/gs-plugin-fedora-distro-upgrades.c
b/plugins/fedora-distro-upgrades/gs-plugin-fedora-distro-upgrades.c
index 21c2096..536861d 100644
--- a/plugins/fedora-distro-upgrades/gs-plugin-fedora-distro-upgrades.c
+++ b/plugins/fedora-distro-upgrades/gs-plugin-fedora-distro-upgrades.c
@@ -341,6 +341,7 @@ sort_distros_cb (gconstpointer a, gconstpointer b)
static GsApp *
gs_plugin_fedora_distro_upgrades_create_app (GsPlugin *plugin, DistroInfo *distro_info)
{
+ GsApp *app;
g_autofree gchar *app_id = NULL;
g_autofree gchar *app_version = NULL;
g_autofree gchar *background = NULL;
@@ -348,7 +349,6 @@ gs_plugin_fedora_distro_upgrades_create_app (GsPlugin *plugin, DistroInfo *distr
g_autofree gchar *css = NULL;
g_autofree gchar *url = NULL;
g_autoptr(AsIcon) ic = NULL;
- g_autoptr(GsApp) app = NULL;
/* search in the cache */
cache_key = g_strdup_printf ("release-%u", distro_info->version);
@@ -403,7 +403,8 @@ gs_plugin_fedora_distro_upgrades_create_app (GsPlugin *plugin, DistroInfo *distr
/* save in the cache */
gs_plugin_cache_add (plugin, cache_key, app);
- return g_steal_pointer (&app);
+ /* success */
+ return app;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]