aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-04 00:33:50 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-04 00:58:00 +0800
commit33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd (patch)
treee04098d43155e6306f5ea77bc548dabebfce3f4a /libempathy
parent937c7947b3ae29cfafc3b6f3f07cf201edfea26c (diff)
downloadgsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.tar
gsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.tar.gz
gsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.tar.bz2
gsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.tar.lz
gsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.tar.xz
gsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.tar.zst
gsoc2013-empathy-33a2f0c2162dfd7ba4e3b77f579c43d5eeb5c8bd.zip
empathy-dispatch-operation: ensure that the operation stays alive while tp_connection_call_when_ready is running (#600551)
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-dispatch-operation.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libempathy/empathy-dispatch-operation.c b/libempathy/empathy-dispatch-operation.c
index d7afcbea6..11ad52302 100644
--- a/libempathy/empathy-dispatch-operation.c
+++ b/libempathy/empathy-dispatch-operation.c
@@ -210,6 +210,13 @@ dispatch_operation_connection_ready (TpConnection *connection,
EmpathyTpContactFactory *factory;
TpHandle handle;
+ if (error != NULL)
+ goto out;
+
+ if (priv->status >= EMPATHY_DISPATCHER_OPERATION_STATE_CLAIMED)
+ /* no point to get more information */
+ goto out;
+
handle = tp_channel_get_handle (priv->channel, NULL);
factory = empathy_tp_contact_factory_dup_singleton (priv->connection);
@@ -218,6 +225,8 @@ dispatch_operation_connection_ready (TpConnection *connection,
dispatcher_operation_got_contact_cb, NULL, NULL, G_OBJECT (self));
g_object_unref (factory);
+out:
+ g_object_unref (self);
}
static void
@@ -239,6 +248,9 @@ empathy_dispatch_operation_constructed (GObject *object)
if (handle_type == TP_HANDLE_TYPE_CONTACT && priv->contact == NULL)
{
+ /* Ensure to keep the self object alive while the call_when_ready is
+ * running */
+ g_object_ref (self);
tp_connection_call_when_ready (priv->connection,
dispatch_operation_connection_ready, object);
return;