Skip to content

Commit

Permalink
Fix crash when closing a document with visible infobars
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
b4n committed Aug 7, 2014
1 parent 8341228 commit a26bdd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/document.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit a26bdd6

Please sign in to comment.