aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-06-19 09:52:36 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-06-19 09:52:36 -0500
commit0ec4365a419db7d7b19e4bd415645ada50a5e5fc (patch)
treeebccbfc45b6001e5599357b042d99f6c68b1e93c
parentdec4af40c78f85b36b995f69da66f30d07270852 (diff)
downloadayatana-indicator-power-0ec4365a419db7d7b19e4bd415645ada50a5e5fc.tar.gz
ayatana-indicator-power-0ec4365a419db7d7b19e4bd415645ada50a5e5fc.tar.bz2
ayatana-indicator-power-0ec4365a419db7d7b19e4bd415645ada50a5e5fc.zip
in provider-upower.c, clear its private hashtable in dispose() and destroy it in finalize()
-rw-r--r--src/device-provider-upower.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/device-provider-upower.c b/src/device-provider-upower.c
index 6dd5029..0fc5d91 100644
--- a/src/device-provider-upower.c
+++ b/src/device-provider-upower.c
@@ -305,7 +305,21 @@ my_dispose (GObject * o)
g_clear_object (&p->upower_proxy);
}
- g_clear_pointer (&p->devices, g_hash_table_destroy);
+ g_hash_table_remove_all (p->devices);
+
+ G_OBJECT_CLASS (indicator_power_device_provider_upower_parent_class)->dispose (o);
+}
+
+static void
+my_finalize (GObject * o)
+{
+ IndicatorPowerDeviceProviderUPower * self;
+ priv_t * p;
+
+ self = INDICATOR_POWER_DEVICE_PROVIDER_UPOWER(o);
+ p = self->priv;
+
+ g_hash_table_destroy (p->devices);
G_OBJECT_CLASS (indicator_power_device_provider_upower_parent_class)->dispose (o);
}
@@ -320,6 +334,7 @@ indicator_power_device_provider_upower_class_init (IndicatorPowerDeviceProviderU
GObjectClass * object_class = G_OBJECT_CLASS (klass);
object_class->dispose = my_dispose;
+ object_class->finalize = my_finalize;
g_type_class_add_private (klass,
sizeof (IndicatorPowerDeviceProviderUPowerPriv));