diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-01 21:15:35 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-01 21:15:35 -0600 |
commit | 176b64b57d0f19af418d88199bf593f96a5a12a7 (patch) | |
tree | 1d94bcaffbda402bdbd5ce6f83aa613c489e05e8 /src/datetime-interface.c | |
parent | 8be0daf8d37a2c53df8f097c389e35c7d4c5ea6b (diff) | |
download | ayatana-indicator-datetime-176b64b57d0f19af418d88199bf593f96a5a12a7.tar.gz ayatana-indicator-datetime-176b64b57d0f19af418d88199bf593f96a5a12a7.tar.bz2 ayatana-indicator-datetime-176b64b57d0f19af418d88199bf593f96a5a12a7.zip |
more use of g_clear_object() where appropriate
Diffstat (limited to 'src/datetime-interface.c')
-rw-r--r-- | src/datetime-interface.c | 13 |
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); |