aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-05-06 00:28:47 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-05-06 00:28:47 +0800
commitd6c6a79e061cd5124b61492ce30b23a8fdd99a92 (patch)
treece65b07f9f451382484ca02dfc4922fe71828fd9
parentda139e6460fadf3fb9c4711572a177fed4b0e7e3 (diff)
downloadgsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.tar
gsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.tar.gz
gsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.tar.bz2
gsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.tar.lz
gsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.tar.xz
gsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.tar.zst
gsoc2013-empathy-d6c6a79e061cd5124b61492ce30b23a8fdd99a92.zip
tube_is_ready: ensure than tube stays alive while we are calling the callbacks
-rw-r--r--libempathy/empathy-tp-tube.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-tube.c b/libempathy/empathy-tp-tube.c
index 717c46876..1946881af 100644
--- a/libempathy/empathy-tp-tube.c
+++ b/libempathy/empathy-tp-tube.c
@@ -258,6 +258,8 @@ tube_is_ready (EmpathyTpTube *self,
priv->ready = TRUE;
+ /* tube has to stay alive while we call the callbacks */
+ g_object_ref (self);
for (l = priv->ready_callbacks ; l != NULL ; l = g_slist_next (l))
{
ReadyCbData *data = (ReadyCbData *) l->data;
@@ -265,6 +267,7 @@ tube_is_ready (EmpathyTpTube *self,
data->callback (self, error, data->user_data, data->weak_object);
ready_cb_data_free (data, self);
}
+ g_object_unref (self);
g_slist_free (priv->ready_callbacks);
priv->ready_callbacks = NULL;