aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-09 16:06:22 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-09 16:06:22 +0800
commit1eb364bb98ec75f0387354e320e07f619319528f (patch)
tree743859e2690ebcca18f701c6fcfd059deabfd7a8 /src
parent43b0a7422d36fce70e7af66460a27fa22b97a36c (diff)
downloadgsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.tar
gsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.tar.gz
gsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.tar.bz2
gsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.tar.lz
gsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.tar.xz
gsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.tar.zst
gsoc2013-empathy-1eb364bb98ec75f0387354e320e07f619319528f.zip
Do not unref tp_chat directly in the message_received callback to avoid a crash.
svn path=/trunk/; revision=1097
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index bd18b2d28..f33447033 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -368,6 +368,13 @@ status_icon_channel_process (EmpathyStatusIcon *icon,
g_object_unref (channel);
}
+static gboolean
+status_icon_chat_unref_idle (gpointer user_data)
+{
+ g_object_unref (user_data);
+ return FALSE;
+}
+
static void
status_icon_chat_message_received_cb (EmpathyTpChat *tp_chat,
EmpathyMessage *message,
@@ -377,6 +384,11 @@ status_icon_chat_message_received_cb (EmpathyTpChat *tp_chat,
gchar *msg;
TpChannel *channel;
+ g_idle_add (status_icon_chat_unref_idle, tp_chat);
+ g_signal_handlers_disconnect_by_func (tp_chat,
+ status_icon_chat_message_received_cb,
+ icon);
+
sender = empathy_message_get_sender (message);
msg = g_strdup_printf (_("New message from %s:\n%s"),
empathy_contact_get_name (sender),
@@ -388,7 +400,6 @@ status_icon_chat_message_received_cb (EmpathyTpChat *tp_chat,
g_object_ref (channel));
g_free (msg);
- g_object_unref (tp_chat);
}
static void