From f5600abfa444ec8ccbca5ffb11c3e649e16f338e Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 18 Mar 2010 15:50:32 +0100 Subject: [PATCH] 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 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 23e85c84..36b4136e 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); -- 2.39.2