[vte/vte-0-38] widget: Do not leave behind a zombie child when closing a terminal
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-38] widget: Do not leave behind a zombie child when closing a terminal
- Date: Thu, 4 Dec 2014 15:12:06 +0000 (UTC)
commit d9d83d455a5b67fcce030c56fbd8de921dc3fa6d
Author: Egmont Koblinger <egmont gmail com>
Date: Mon Dec 1 13:30:52 2014 +0100
widget: Do not leave behind a zombie child when closing a terminal
https://bugzilla.gnome.org/show_bug.cgi?id=740929
(cherry picked from commit 31b150146189b49fadd126edc1c373ada234c865)
src/vte.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index c6172fc..e5149c9 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -3210,6 +3210,12 @@ vte_terminal_child_watch_cb(GPid pid,
int status,
VteTerminal *terminal)
{
+ if (terminal == NULL) {
+ /* The child outlived VteTerminal. Do nothing, we're happy that Glib
+ * read its exit data and hence it's no longer there as zombie. */
+ return;
+ }
+
if (pid == terminal->pvt->pty_pid) {
GObject *object = G_OBJECT(terminal);
@@ -8416,11 +8422,15 @@ vte_terminal_finalize(GObject *object)
terminal->pvt->outgoing_conv = VTE_INVALID_CONV;
}
- /* Stop listening for child-exited signals. */
+ /* Start listening for child-exited signals and ignore them, so that no zombie child is left behind.
*/
if (terminal->pvt->child_watch_source != 0) {
g_source_remove (terminal->pvt->child_watch_source);
terminal->pvt->child_watch_source = 0;
}
+ g_child_watch_add_full(G_PRIORITY_HIGH,
+ terminal->pvt->pty_pid,
+ (GChildWatchFunc)vte_terminal_child_watch_cb,
+ NULL, NULL);
/* Stop processing input. */
vte_terminal_stop_processing (terminal);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]