From f4e1a83d20cad3afa6dd51a4a520ef21ccaff5cd Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 24 Jul 2014 15:14:20 -0500 Subject: in notifier.c, don't keep pointers to the bindings around as they're cleaned up automatically when either of the objects is destroyed. --- src/notifier.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/notifier.c b/src/notifier.c index c6b0025..1986f8c 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -73,8 +73,6 @@ struct _IndicatorPowerNotifierPrivate GDBusConnection * bus; DbusBattery * dbus_battery; /* com.canonical.indicator.power.Battery skeleton */ - GBinding * is_warning_binding; /* pushes our property to dbus_battery */ - GBinding * power_level_binding; /* pushes our property to dbus_battery */ }; typedef IndicatorPowerNotifierPrivate priv_t; @@ -269,8 +267,6 @@ my_dispose (GObject * o) indicator_power_notifier_set_bus (self, NULL); notification_clear (self); - g_clear_object (&p->power_level_binding); - g_clear_object (&p->is_warning_binding); g_clear_object (&p->dbus_battery); indicator_power_notifier_set_battery (self, NULL); @@ -305,17 +301,17 @@ indicator_power_notifier_init (IndicatorPowerNotifier * self) p->dbus_battery = dbus_battery_skeleton_new (); - p->is_warning_binding = g_object_bind_property (self, - PROP_IS_WARNING_NAME, - p->dbus_battery, - PROP_IS_WARNING_NAME, - G_BINDING_SYNC_CREATE); - - p->power_level_binding = g_object_bind_property (self, - PROP_POWER_LEVEL_NAME, - p->dbus_battery, - PROP_POWER_LEVEL_NAME, - G_BINDING_SYNC_CREATE); + g_object_bind_property (self, + PROP_IS_WARNING_NAME, + p->dbus_battery, + PROP_IS_WARNING_NAME, + G_BINDING_SYNC_CREATE); + + g_object_bind_property (self, + PROP_POWER_LEVEL_NAME, + p->dbus_battery, + PROP_POWER_LEVEL_NAME, + G_BINDING_SYNC_CREATE); if (!instance_count++) { -- cgit v1.2.3