aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-power.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-10-26 09:05:25 +0200
committerCharles Kerr <charles.kerr@canonical.com>2012-10-26 09:05:25 +0200
commit8659889054f49ff674562c0f7c8ae7929e837d67 (patch)
tree86abb268e30631f528ab89030a1f69c88ef89a21 /src/indicator-power.c
parent90af0bf84104879548df739a20958d04e832c50a (diff)
downloadayatana-indicator-power-8659889054f49ff674562c0f7c8ae7929e837d67.tar.gz
ayatana-indicator-power-8659889054f49ff674562c0f7c8ae7929e837d67.tar.bz2
ayatana-indicator-power-8659889054f49ff674562c0f7c8ae7929e837d67.zip
fix leaked icon and label; found by running valgrind on tests/test-indicator
Diffstat (limited to 'src/indicator-power.c')
-rw-r--r--src/indicator-power.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 9829839..ebfc2c1 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -150,6 +150,8 @@ indicator_power_dispose (GObject *object)
dispose_devices (self);
+ g_clear_object (&priv->label);
+ g_clear_object (&priv->status_image);
g_clear_object (&priv->dbus_listener);
g_clear_object (&priv->settings);
@@ -489,6 +491,7 @@ get_label (IndicatorObject *io)
{
/* Create the label if it doesn't exist already */
priv->label = GTK_LABEL (gtk_label_new (""));
+ g_object_ref_sink (priv->label);
gtk_widget_set_visible (GTK_WIDGET (priv->label), FALSE);
}
@@ -508,6 +511,7 @@ get_image (IndicatorObject *io)
gicon = g_themed_icon_new (DEFAULT_ICON);
priv->status_image = GTK_IMAGE (gtk_image_new_from_gicon (gicon,
GTK_ICON_SIZE_LARGE_TOOLBAR));
+ g_object_ref_sink (priv->status_image);
g_object_unref (gicon);
}