Skip to content

Commit

Permalink
Fix a segfault bug for vte-0.54. VERY THANKS to Bernhard Übelacker fo…
Browse files Browse the repository at this point in the history
…r the patch. close #134
  • Loading branch information
Tetralet committed Jul 25, 2019
1 parent 1aa784b commit faf1254
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/data.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,8 @@ struct Page
guint timeout_id;
// the id of urgent_bell g_signal
gulong urgent_bell_handler_id;
// the id of child_exited g_signal
gulong child_exited_handler_id;

// ---- font ---- //

Expand Down
Empty file modified src/dialog.c
100755 → 100644
Empty file.
Empty file modified src/menu.c
100755 → 100644
Empty file.
5 changes: 4 additions & 1 deletion src/notebook.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ struct Page *add_page(struct Window *win_data,
G_CALLBACK(vte_size_changed), GINT_TO_POINTER(FONT_ZOOM_OUT));
// the close page event
if (! (win_data->hold && win_data->command))
g_signal_connect(G_OBJECT(page_data->vte), "child_exited", G_CALLBACK(close_page), GINT_TO_POINTER(CLOSE_TAB_NORMAL));
page_data->child_exited_handler_id = g_signal_connect(G_OBJECT(page_data->vte), "child_exited", G_CALLBACK(close_page), GINT_TO_POINTER(CLOSE_TAB_NORMAL));

// when get focus, update `current_vte', hints, and window title
g_signal_connect(G_OBJECT(page_data->vte), "grab-focus", G_CALLBACK(vte_grab_focus), NULL);
Expand Down Expand Up @@ -998,6 +998,8 @@ gboolean close_page(GtkWidget *vte, gint close_type)
g_source_remove (page_data->timeout_id);
if (page_data->urgent_bell_handler_id)
g_signal_handler_disconnect(G_OBJECT(page_data->vte), page_data->urgent_bell_handler_id);
if (page_data->child_exited_handler_id)
g_signal_handler_disconnect(G_OBJECT(page_data->vte), page_data->child_exited_handler_id);

// kill running shell
#ifdef SAFEMODE
Expand Down Expand Up @@ -1935,6 +1937,7 @@ void page_data_dup(struct Page *page_data_prev, struct Page *page_data)

page_data->timeout_id = 0;
page_data->urgent_bell_handler_id = 0;
page_data->child_exited_handler_id = 0;

page_data->font_name = g_strdup(page_data_prev->font_name);
// page_data->font_size = 0;
Expand Down
1 change: 1 addition & 0 deletions src/profile.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ void init_page_parameters(struct Window *win_data, struct Page *page_data)

// page_data->timeout_id = 0;
// page_data->urgent_bell_handler_id = 0;
// page_data->child_exited_handler_id = 0;

page_data->font_name = g_strdup(win_data->default_font_name);
// page_data->font_size = 0;
Expand Down
1 change: 1 addition & 0 deletions src/window.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3124,6 +3124,7 @@ void dump_data (struct Window *win_data, struct Page *page_data)
g_debug("- page_data->window_title_signal = %ld", page_data->window_title_signal);
g_debug("- page_data->timeout_id = %d", page_data->timeout_id);
g_debug("- page_data->urgent_bell_handler_id = %ld", page_data->urgent_bell_handler_id);
g_debug("- page_data->child_exited_handler_id = %ld", page_data->child_exited_handler_id);
g_debug("- page_data->font_name = %s", page_data->font_name);
g_debug("- page_data->font_size = %d", page_data->font_size);
g_debug("- page_data->check_root_privileges = %d", page_data->check_root_privileges);
Expand Down

0 comments on commit faf1254

Please sign in to comment.