From d6c6a79e061cd5124b61492ce30b23a8fdd99a92 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 5 May 2009 17:28:47 +0100 Subject: tube_is_ready: ensure than tube stays alive while we are calling the callbacks --- libempathy/empathy-tp-tube.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libempathy') 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; -- cgit v1.2.3