segfault.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. === modified file 'src/sakura.c'
  2. --- src/sakura.c 2018-05-02 19:22:43 +0000
  3. +++ src/sakura.c 2018-09-16 13:26:19 +0000
  4. @@ -339,6 +339,7 @@
  5. bool label_set_byuser;
  6. GtkBorder padding; /* inner-property data */
  7. int colorset;
  8. + gulong exit_handler_id;
  9. };
  10. @@ -984,31 +985,6 @@
  11. if (npages==1) {
  12. sakura_config_done();
  13. }
  14. -
  15. - /* Workaround for libvte strange behaviour. There is not child-exited signal for
  16. - the last terminal, so we need to kill it here. Check with libvte authors about
  17. - child-exited/eof signals */
  18. - if (gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook))==0) {
  19. -
  20. - term = sakura_get_page_term(sakura, 0);
  21. -
  22. - if (option_hold==TRUE) {
  23. - SAY("hold option has been activated");
  24. - return;
  25. - }
  26. -
  27. - //SAY("waiting for terminal pid (in eof) %d", term->pid);
  28. - //waitpid(term->pid, &status, WNOHANG);
  29. - /* TODO: check wait return */
  30. - /* Child should be automatically reaped because we don't use G_SPAWN_DO_NOT_REAP_CHILD flag */
  31. - g_spawn_close_pid(term->pid);
  32. -
  33. - sakura_del_tab(0);
  34. -
  35. - npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(sakura.notebook));
  36. - if (npages==0)
  37. - sakura_destroy();
  38. - }
  39. }
  40. /* This handler is called when window title changes, and is used to change window and notebook pages titles */
  41. @@ -3167,7 +3143,7 @@
  42. g_signal_connect(G_OBJECT(term->vte), "bell", G_CALLBACK(sakura_beep), NULL);
  43. g_signal_connect(G_OBJECT(term->vte), "increase-font-size", G_CALLBACK(sakura_increase_font), NULL);
  44. g_signal_connect(G_OBJECT(term->vte), "decrease-font-size", G_CALLBACK(sakura_decrease_font), NULL);
  45. - g_signal_connect(G_OBJECT(term->vte), "child-exited", G_CALLBACK(sakura_child_exited), NULL);
  46. + term->exit_handler_id = g_signal_connect(G_OBJECT(term->vte), "child-exited", G_CALLBACK(sakura_child_exited), NULL);
  47. g_signal_connect(G_OBJECT(term->vte), "eof", G_CALLBACK(sakura_eof), NULL);
  48. g_signal_connect(G_OBJECT(term->vte), "window-title-changed", G_CALLBACK(sakura_title_changed), NULL);
  49. g_signal_connect_swapped(G_OBJECT(term->vte), "button-press-event", G_CALLBACK(sakura_button_press), sakura.menu);
  50. @@ -3366,6 +3342,7 @@
  51. }
  52. gtk_widget_hide(term->hbox);
  53. + g_signal_handler_disconnect (term->vte, term->exit_handler_id);
  54. gtk_notebook_remove_page(GTK_NOTEBOOK(sakura.notebook), page);
  55. /* Find the next page, if it exists, and grab focus */