Merge lp:~ted/indicator-application/lp829961 into lp:indicator-application/0.4

Proposed by Ted Gould
Status: Merged
Merged at revision: 212
Proposed branch: lp:~ted/indicator-application/lp829961
Merge into: lp:indicator-application/0.4
Diff against target: 46 lines (+12/-0)
1 file modified
src/application-service-appstore.c (+12/-0)
To merge this branch: bzr merge lp:~ted/indicator-application/lp829961
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+75438@code.launchpad.net

Description of the change

Adding a free of properties that are already set when we grab them twice.

To post a comment you must log in.
Revision history for this message
Hernando Torque (htorque) wrote :

No change in memory usage over 20 minutes → this seems to fix it. :)

Revision history for this message
Neil J. Patel (njpatel) wrote :

Looks good, approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/application-service-appstore.c'
2--- src/application-service-appstore.c 2011-07-22 20:35:19 +0000
3+++ src/application-service-appstore.c 2011-09-14 22:10:19 +0000
4@@ -508,6 +508,14 @@
5 else {
6 app->validated = TRUE;
7
8+ /* It is possible we're coming through a second time and
9+ getting the properties. So we need to ensure we don't
10+ already have them stored */
11+ g_free(app->id);
12+ g_free(app->category);
13+ g_free(app->icon);
14+ g_free(app->menu);
15+
16 app->id = g_variant_dup_string(id, NULL);
17 app->category = g_variant_dup_string(category, NULL);
18 app->status = string_to_status(g_variant_get_string(status, NULL));
19@@ -516,10 +524,12 @@
20
21 /* Now the optional properties */
22
23+ g_free(app->aicon);
24 if (aicon_name != NULL) {
25 app->aicon = g_variant_dup_string(aicon_name, NULL);
26 }
27
28+ g_free(app->icon_theme_path);
29 if (icon_theme_path != NULL) {
30 app->icon_theme_path = g_variant_dup_string(icon_theme_path, NULL);
31 } else {
32@@ -539,12 +549,14 @@
33 g_debug("'%s' ordering index is '%X'", app->id, app->ordering_index);
34 app->appstore->priv->applications = g_list_sort_with_data(app->appstore->priv->applications, app_sort_func, NULL);
35
36+ g_free(app->label);
37 if (label != NULL) {
38 app->label = g_variant_dup_string(label, NULL);
39 } else {
40 app->label = g_strdup("");
41 }
42
43+ g_free(app->guide);
44 if (guide != NULL) {
45 app->guide = g_variant_dup_string(guide, NULL);
46 } else {

Subscribers

People subscribed via source and target branches