aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2011-09-16 16:21:36 -0400
committerMichael Terry <michael.terry@canonical.com>2011-09-16 16:21:36 -0400
commita11c8767e1769acf8a1da6a9d6f7d0df5f13a447 (patch)
tree4d65df570e94a24500a407f03ebefeb13c7def59
parent3bb503c831ba18d97a05419dc44781076712ea74 (diff)
downloadayatana-indicator-application-a11c8767e1769acf8a1da6a9d6f7d0df5f13a447.tar.gz
ayatana-indicator-application-a11c8767e1769acf8a1da6a9d6f7d0df5f13a447.tar.bz2
ayatana-indicator-application-a11c8767e1769acf8a1da6a9d6f7d0df5f13a447.zip
free application fields before resetting them to new values
-rw-r--r--src/application-service-appstore.c32
1 files changed, 32 insertions, 0 deletions
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);
}