aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-interface.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-03-03 10:23:06 -0600
committerCharles Kerr <charles.kerr@canonical.com>2012-03-03 10:23:06 -0600
commita7ffebd9859ded9e44ec6a5b5dca9fb771eac209 (patch)
tree281a7dd4cc36debe3a72c7e5f7109d939370b6ad /src/datetime-interface.c
parent59ade0a5dad1cb85f3576fc89c323a8baceb3a5e (diff)
parentad8b10b4665dbab7a58f0272de9cb3009d0c74b0 (diff)
downloadayatana-indicator-datetime-a7ffebd9859ded9e44ec6a5b5dca9fb771eac209.tar.gz
ayatana-indicator-datetime-a7ffebd9859ded9e44ec6a5b5dca9fb771eac209.tar.bz2
ayatana-indicator-datetime-a7ffebd9859ded9e44ec6a5b5dca9fb771eac209.zip
merging lp:~charlesk/indicator-datetime/fix-833337 and lp:~charlesk/indicator-datetime/fix-leaks
Diffstat (limited to 'src/datetime-interface.c')
-rw-r--r--src/datetime-interface.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/datetime-interface.c b/src/datetime-interface.c
index 5939061..e67be85 100644
--- a/src/datetime-interface.c
+++ b/src/datetime-interface.c
@@ -124,10 +124,7 @@ bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data)
g_warn_if_fail(priv->bus == NULL);
priv->bus = connection;
- if (priv->bus_cancel != NULL) {
- g_object_unref(priv->bus_cancel);
- priv->bus_cancel = NULL;
- }
+ g_clear_object (&priv->bus_cancel);
/* Now register our object on our new connection */
priv->dbus_registration = g_dbus_connection_register_object(priv->bus,
@@ -158,15 +155,11 @@ datetime_interface_dispose (GObject *object)
priv->dbus_registration = 0;
}
- if (priv->bus != NULL) {
- g_object_unref(priv->bus);
- priv->bus = NULL;
- }
+ g_clear_object (&priv->bus);
if (priv->bus_cancel != NULL) {
g_cancellable_cancel(priv->bus_cancel);
- g_object_unref(priv->bus_cancel);
- priv->bus_cancel = NULL;
+ g_clear_object (&priv->bus_cancel);
}
G_OBJECT_CLASS (datetime_interface_parent_class)->dispose (object);