aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-24 15:14:20 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-24 15:14:20 -0500
commitf4e1a83d20cad3afa6dd51a4a520ef21ccaff5cd (patch)
tree37f9e8fa9c02e9f5782f39adbcf19135b322da90 /src
parent8b9a80174263c601952d6c31cbcd344c85d096dd (diff)
downloadayatana-indicator-power-f4e1a83d20cad3afa6dd51a4a520ef21ccaff5cd.tar.gz
ayatana-indicator-power-f4e1a83d20cad3afa6dd51a4a520ef21ccaff5cd.tar.bz2
ayatana-indicator-power-f4e1a83d20cad3afa6dd51a4a520ef21ccaff5cd.zip
in notifier.c, don't keep pointers to the bindings around as they're cleaned up automatically when either of the objects is destroyed.
Diffstat (limited to 'src')
-rw-r--r--src/notifier.c26
1 files 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++)
{