[empathy] chat: use empathy_signal_connect_weak to connect signal on the buffer



commit f5600abfa444ec8ccbca5ffb11c3e649e16f338e
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Mar 18 15:50:32 2010 +0100

    chat: use empathy_signal_connect_weak to connect signal on the buffer
    
    The textview can't survive once the EmpathyChat has been destroyed but if for
    some reason its buffer it's still alive, firing this signal leads to a crash
    (#612363).

 libempathy-gtk/empathy-chat.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 23e85c8..36b4136 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -2252,9 +2252,9 @@ chat_create_ui (EmpathyChat *chat)
 			  G_CALLBACK (chat_input_populate_popup_cb),
 			  chat);
 	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view));
-	g_signal_connect (buffer, "changed",
+	empathy_signal_connect_weak  (buffer, "changed",
 			  G_CALLBACK (chat_input_text_buffer_changed_cb),
-			  chat);
+			  G_OBJECT (chat));
 	gtk_text_buffer_create_tag (buffer, "misspelled",
 				    "underline", PANGO_UNDERLINE_ERROR,
 				    NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]