From 820cc22b429e6b89f107b9d7baf4414e4c49a338 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 15 Apr 2012 09:23:24 -0500 Subject: tweak: in put_primary_device(), peek at the variant's strings instead of dup'ing them --- src/indicator-power.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/indicator-power.c b/src/indicator-power.c index cf16fbf..1b3794e 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -785,15 +785,15 @@ put_primary_device (IndicatorPower *self, gchar *short_details = NULL; gchar *details = NULL; gchar *accessible_name = NULL; - gchar *device_icon = NULL; - gchar *object_path = NULL; + const gchar *device_icon = NULL; + const gchar *object_path = NULL; gdouble percentage; guint64 time; const gchar *device_name; /* set the icon and text */ g_variant_get (device, - "(susdut)", + "(&su&sdut)", &object_path, &kind, &device_icon, @@ -825,8 +825,6 @@ put_primary_device (IndicatorPower *self, g_free (short_details); g_free (details); g_free (accessible_name); - g_free (device_icon); - g_free (object_path); } static void -- cgit v1.2.3