summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-09-21 15:09:35 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-09-21 15:09:35 +0100
commit3769699b2b6b17a709e4d70c9fe1faee26a1f909 (patch)
treecb18041341cb677c95e8af70c460b3a0c2326d2b /plugins
parenta3baf27590d80db48ecf573ef2d0634de4e9db8f (diff)
plugins: use tp_clear_object in simple cases
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gateways.c18
-rw-r--r--plugins/test.c17
2 files changed, 8 insertions, 27 deletions
diff --git a/plugins/gateways.c b/plugins/gateways.c
index 32435387e..c5513f0c6 100644
--- a/plugins/gateways.c
+++ b/plugins/gateways.c
@@ -23,9 +23,7 @@
#include <string.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/errors.h>
+#include <telepathy-glib/telepathy-glib.h>
#include <wocky/wocky-namespaces.h>
#include <wocky/wocky-xmpp-error.h>
@@ -214,11 +212,7 @@ gabble_gateway_sidecar_dispose (GObject *object)
G_OBJECT_CLASS (gabble_gateway_sidecar_parent_class)->dispose;
GabbleGatewaySidecar *self = GABBLE_GATEWAY_SIDECAR (object);
- if (self->priv->connection != NULL)
- {
- g_object_unref (self->priv->connection);
- self->priv->connection = NULL;
- }
+ tp_clear_object (&self->priv->connection);
if (self->priv->session != NULL)
{
@@ -226,10 +220,10 @@ gabble_gateway_sidecar_dispose (GObject *object)
wocky_porter_unregister_handler (porter, self->priv->subscribe_id);
wocky_porter_unregister_handler (porter, self->priv->subscribed_id);
- g_object_unref (self->priv->session);
- self->priv->session = NULL;
}
+ tp_clear_object (&self->priv->session);
+
if (chain_up != NULL)
chain_up (object);
}
@@ -456,9 +450,7 @@ register_cb (GObject *source,
pr->context = NULL;
}
- if (reply != NULL)
- g_object_unref (reply);
-
+ tp_clear_object (&reply);
pending_registration_free (pr);
}
diff --git a/plugins/test.c b/plugins/test.c
index 109567962..be7a42cd8 100644
--- a/plugins/test.c
+++ b/plugins/test.c
@@ -2,9 +2,7 @@
#include <stdio.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/errors.h>
+#include <telepathy-glib/telepathy-glib.h>
#include "extensions/extensions.h"
@@ -339,17 +337,8 @@ test_sidecar_iq_dispose (GObject *object)
DEBUG ("called for %p", object);
- if (self->session != NULL)
- {
- g_object_unref (self->session);
- self->session = NULL;
- }
-
- if (self->connection != NULL)
- {
- g_object_unref (self->connection);
- self->connection = NULL;
- }
+ tp_clear_object (&self->session);
+ tp_clear_object (&self->connection);
}
static void