From 2f9133d26d836d4fcca9b917b5e8e075ac5c5737 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 14 Sep 2011 17:08:19 -0500 Subject: Freeing properties on second run of building the app indicator --- src/application-service-appstore.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index d59cfe9..7b9c652 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -508,6 +508,14 @@ got_all_properties (GObject * source_object, GAsyncResult * res, else { app->validated = TRUE; + /* It is possible we're coming through a second time and + getting the properties. So we need to ensure we don't + already have them stored */ + g_free(app->id); + g_free(app->category); + g_free(app->icon); + g_free(app->menu); + app->id = g_variant_dup_string(id, NULL); app->category = g_variant_dup_string(category, NULL); app->status = string_to_status(g_variant_get_string(status, NULL)); @@ -516,10 +524,12 @@ got_all_properties (GObject * source_object, GAsyncResult * res, /* Now the optional properties */ + g_free(app->aicon); if (aicon_name != NULL) { app->aicon = g_variant_dup_string(aicon_name, NULL); } + g_free(app->icon_theme_path); if (icon_theme_path != NULL) { app->icon_theme_path = g_variant_dup_string(icon_theme_path, NULL); } else { @@ -539,12 +549,14 @@ got_all_properties (GObject * source_object, GAsyncResult * res, g_debug("'%s' ordering index is '%X'", app->id, app->ordering_index); app->appstore->priv->applications = g_list_sort_with_data(app->appstore->priv->applications, app_sort_func, NULL); + g_free(app->label); if (label != NULL) { app->label = g_variant_dup_string(label, NULL); } else { app->label = g_strdup(""); } + g_free(app->guide); if (guide != NULL) { app->guide = g_variant_dup_string(guide, NULL); } else { -- cgit v1.2.3 From a11c8767e1769acf8a1da6a9d6f7d0df5f13a447 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Fri, 16 Sep 2011 16:21:36 -0400 Subject: free application fields before resetting them to new values --- src/application-service-appstore.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index d59cfe9..e7483aa 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -508,6 +508,18 @@ got_all_properties (GObject * source_object, GAsyncResult * res, else { app->validated = TRUE; + /* Clear all existing data */ + g_free(app->id); + g_free(app->category); + g_free(app->icon); + g_free(app->menu); + g_free(app->icon_desc); + g_free(app->aicon); + g_free(app->aicon_desc); + g_free(app->icon_theme_path); + g_free(app->label); + g_free(app->guide); + app->id = g_variant_dup_string(id, NULL); app->category = g_variant_dup_string(category, NULL); app->status = string_to_status(g_variant_get_string(status, NULL)); @@ -516,9 +528,26 @@ got_all_properties (GObject * source_object, GAsyncResult * res, /* Now the optional properties */ + if (icon_desc != NULL) { + app->icon_desc = g_variant_dup_string(icon_desc, NULL); + } + else { + app->icon_desc = g_strdup(""); + } + if (aicon_name != NULL) { app->aicon = g_variant_dup_string(aicon_name, NULL); } + else { + app->aicon = g_strdup(""); + } + + if (aicon_desc != NULL) { + app->aicon_desc = g_variant_dup_string(aicon_desc, NULL); + } + else { + app->aicon_desc = g_strdup(""); + } if (icon_theme_path != NULL) { app->icon_theme_path = g_variant_dup_string(icon_theme_path, NULL); @@ -736,6 +765,9 @@ application_free (Application * app) if (app->icon_desc != NULL) { g_free(app->icon_desc); } + if (app->aicon != NULL) { + g_free(app->aicon); + } if (app->aicon_desc != NULL) { g_free(app->aicon_desc); } -- cgit v1.2.3 From 21a6e471080b9a2f2a7e15967e9584a2d606e02b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Sep 2011 16:37:06 -0500 Subject: Ensure we set a default value for aicon --- src/application-service-appstore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 7b9c652..76e1c4a 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -527,6 +527,8 @@ got_all_properties (GObject * source_object, GAsyncResult * res, g_free(app->aicon); if (aicon_name != NULL) { app->aicon = g_variant_dup_string(aicon_name, NULL); + } else { + app->aicon = NULL; } g_free(app->icon_theme_path); -- cgit v1.2.3 From ec05da4c7b67aa27d9da78027d4c7d826519c43b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Sep 2011 08:49:10 -0500 Subject: 0.4.0 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3b0bfe3..33a6260 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(indicator-application, 0.3.92, ted@canonical.com) +AC_INIT(indicator-application, 0.4.0, ted@canonical.com) AC_COPYRIGHT([Copyright 2009, 2010 Canonical]) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-application, 0.3.92) +AM_INIT_AUTOMAKE(indicator-application, 0.4.0) AM_MAINTAINER_MODE -- cgit v1.2.3 From 77b5c42947e2f5ed8ba690223824fe71e34f12f4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Sep 2011 10:02:14 -0500 Subject: releasing version 0.4.0-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 77f8bd5..d1d2927 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.4.0-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-application (0.4.0-0ubuntu1~ppa1) oneiric; urgency=low * New upstream release. * Fix memory leak (LP: #829961) - -- Ted Gould Wed, 28 Sep 2011 09:53:06 -0500 + -- Ted Gould Wed, 28 Sep 2011 10:02:11 -0500 indicator-application (0.3.92-0ubuntu1~ppa1) oneiric; urgency=low -- cgit v1.2.3