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
=== modified file 'src/application-service-appstore.c'
--- src/application-service-appstore.c 2011-07-22 20:35:19 +0000
+++ src/application-service-appstore.c 2011-09-14 22:10:19 +0000
@@ -508,6 +508,14 @@
508 else {508 else {
509 app->validated = TRUE;509 app->validated = TRUE;
510510
511 /* It is possible we're coming through a second time and
512 getting the properties. So we need to ensure we don't
513 already have them stored */
514 g_free(app->id);
515 g_free(app->category);
516 g_free(app->icon);
517 g_free(app->menu);
518
511 app->id = g_variant_dup_string(id, NULL);519 app->id = g_variant_dup_string(id, NULL);
512 app->category = g_variant_dup_string(category, NULL);520 app->category = g_variant_dup_string(category, NULL);
513 app->status = string_to_status(g_variant_get_string(status, NULL));521 app->status = string_to_status(g_variant_get_string(status, NULL));
@@ -516,10 +524,12 @@
516524
517 /* Now the optional properties */525 /* Now the optional properties */
518526
527 g_free(app->aicon);
519 if (aicon_name != NULL) {528 if (aicon_name != NULL) {
520 app->aicon = g_variant_dup_string(aicon_name, NULL);529 app->aicon = g_variant_dup_string(aicon_name, NULL);
521 }530 }
522531
532 g_free(app->icon_theme_path);
523 if (icon_theme_path != NULL) {533 if (icon_theme_path != NULL) {
524 app->icon_theme_path = g_variant_dup_string(icon_theme_path, NULL);534 app->icon_theme_path = g_variant_dup_string(icon_theme_path, NULL);
525 } else {535 } else {
@@ -539,12 +549,14 @@
539 g_debug("'%s' ordering index is '%X'", app->id, app->ordering_index);549 g_debug("'%s' ordering index is '%X'", app->id, app->ordering_index);
540 app->appstore->priv->applications = g_list_sort_with_data(app->appstore->priv->applications, app_sort_func, NULL);550 app->appstore->priv->applications = g_list_sort_with_data(app->appstore->priv->applications, app_sort_func, NULL);
541551
552 g_free(app->label);
542 if (label != NULL) {553 if (label != NULL) {
543 app->label = g_variant_dup_string(label, NULL);554 app->label = g_variant_dup_string(label, NULL);
544 } else {555 } else {
545 app->label = g_strdup("");556 app->label = g_strdup("");
546 }557 }
547558
559 g_free(app->guide);
548 if (guide != NULL) {560 if (guide != NULL) {
549 app->guide = g_variant_dup_string(guide, NULL);561 app->guide = g_variant_dup_string(guide, NULL);
550 } else {562 } else {

Subscribers

People subscribed via source and target branches