diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-09-11 11:40:40 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-09-11 11:40:40 -0500 |
commit | 4ca541cc16b60f29a03694034900c30b4d8a5cbd (patch) | |
tree | 43625044ae598e87832fa50cd001a50d8ef5f306 | |
parent | ce4067c8054de62ac8f54676103253312d80396f (diff) | |
download | ayatana-indicator-power-4ca541cc16b60f29a03694034900c30b4d8a5cbd.tar.gz ayatana-indicator-power-4ca541cc16b60f29a03694034900c30b4d8a5cbd.tar.bz2 ayatana-indicator-power-4ca541cc16b60f29a03694034900c30b4d8a5cbd.zip |
use g_variant_new_take_string() where appropriate
-rw-r--r-- | src/service.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/service.c b/src/service.c index 85d6202..b5227f6 100644 --- a/src/service.c +++ b/src/service.c @@ -338,11 +338,7 @@ create_header_state (IndicatorPowerService * self) g_variant_new_boolean (should_be_visible (self))); if (label != NULL) - { - g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (label)); - - g_free (label); - } + g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (label)); if (icon != NULL) { @@ -352,12 +348,7 @@ create_header_state (IndicatorPowerService * self) } if (a11y != NULL) - { - g_variant_builder_add (&b, "{sv}", "accessible-desc", - g_variant_new_string (a11y)); - - g_free (a11y); - } + g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_take_string (a11y)); return g_variant_builder_end (&b); } |