[empathy/gnome-3-4] empathy-chat: abort got_filtered_messages_cb if object was destroyed
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-3-4] empathy-chat: abort got_filtered_messages_cb if object was destroyed
- Date: Wed, 27 Jun 2012 11:50:34 +0000 (UTC)
commit ce6c9f9122d89b33187a831478bfbaa256645502
Author: Debarshi Ray <debarshir src gnome org>
Date: Thu Jun 7 19:33:05 2012 +0200
empathy-chat: abort got_filtered_messages_cb if object was destroyed
Fixes: https://bugzilla.gnome.org/677641
libempathy-gtk/empathy-chat.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index e6019f8..d5e72cb 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -2572,10 +2572,18 @@ got_filtered_messages_cb (GObject *manager,
{
GList *l;
GList *messages;
- EmpathyChat *chat = EMPATHY_CHAT (user_data);
- EmpathyChatPriv *priv = GET_PRIV (chat);
+ TpWeakRef *wr = user_data;
+ EmpathyChat *chat = tp_weak_ref_dup_object (wr);
+ EmpathyChatPriv *priv;
GError *error = NULL;
+ if (chat == NULL) {
+ tp_weak_ref_destroy (wr);
+ return;
+ }
+
+ priv = GET_PRIV (chat);
+
if (!tpl_log_manager_get_filtered_events_finish (TPL_LOG_MANAGER (manager),
result, &messages, &error)) {
DEBUG ("%s. Aborting.", error->message);
@@ -2637,6 +2645,9 @@ out:
/* Turn back on scrolling */
empathy_chat_view_scroll (chat->view, TRUE);
+
+ g_object_unref (chat);
+ tp_weak_ref_destroy (wr);
}
static void
@@ -2667,7 +2678,7 @@ chat_add_logs (EmpathyChat *chat)
chat_log_filter,
chat,
got_filtered_messages_cb,
- (gpointer) chat);
+ tp_weak_ref_new (chat, NULL, NULL));
g_object_unref (target);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]