aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application-service-appstore.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index e7483aa..edc517f 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -508,17 +508,13 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
else {
app->validated = TRUE;
- /* Clear all existing data */
+ /* 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);
- 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);
@@ -528,6 +524,7 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
/* Now the optional properties */
+ g_free(app->icon_desc);
if (icon_desc != NULL) {
app->icon_desc = g_variant_dup_string(icon_desc, NULL);
}
@@ -535,13 +532,14 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
app->icon_desc = g_strdup("");
}
+ g_free(app->aicon);
if (aicon_name != NULL) {
app->aicon = g_variant_dup_string(aicon_name, NULL);
- }
- else {
+ } else {
app->aicon = g_strdup("");
}
+ g_free(app->aicon_desc);
if (aicon_desc != NULL) {
app->aicon_desc = g_variant_dup_string(aicon_desc, NULL);
}
@@ -549,6 +547,7 @@ got_all_properties (GObject * source_object, GAsyncResult * res,
app->aicon_desc = g_strdup("");
}
+ g_free(app->icon_theme_path);
if (icon_theme_path != NULL) {
app->icon_theme_path = g_variant_dup_string(icon_theme_path, NULL);
} else {
@@ -568,12 +567,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 {