Fix crash when closing a document with visible infobars
Apparently the ::unrealize symbol is sent too late, after we destroyed the widget and freed the GeanyDocument, and some signals like ::focus-in-event can still be fired on the widget after that. So, properly use the ::destroy signal that is supposed to be fired when others should release references to that instance.
This commit is contained in:
parent
8341228ffa
commit
a26bdd628f
@ -3215,7 +3215,7 @@ 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_object(bar, "unrealize", G_CALLBACK(gtk_widget_grab_focus), doc->editor->sci,
|
||||
g_signal_connect_object(bar, "destroy", 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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user