From 0682a255853bada9bb5a07a575100925997e1de9 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 26 Jul 2014 13:36:19 +0200 Subject: [PATCH] Fix crash when quitting with an infobar visible When the infobar gets closed/destroyed it tries to focus the possibly destroyed document, leading to a crash. --- src/document.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/document.c b/src/document.c index 799f26622..1358f8a75 100644 --- a/src/document.c +++ b/src/document.c @@ -3214,7 +3214,8 @@ static gboolean on_sci_key(GtkWidget *widget, GdkEventKey *event, gpointer data) static void enable_key_intercept(GeanyDocument *doc, GtkWidget *bar) { /* automatically focus editor again on bar close */ - g_signal_connect_swapped(bar, "unrealize", G_CALLBACK(document_grab_focus), doc); + g_signal_connect_object(bar, "unrealize", G_CALLBACK(gtk_widget_grab_focus), doc->editor->sci, + G_CONNECT_SWAPPED); g_signal_connect_object(doc->editor->sci, "key-press-event", G_CALLBACK(on_sci_key), bar, 0); } -- 2.11.4.GIT