aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-12 08:21:01 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-21 10:55:20 +0000
commite563c863d174ecdf924ab9bb4fc19a248748e8b8 (patch)
tree15d6a641c67fe79cd097d94dcfa6e24696fad511
parentpgo: stub implementation of reaper_del() (diff)
term: remove client application’s pid from reaper when shutting down
When we are shutting down the terminal, we explicitly wait for the child application to terminate (with a timeout, after which the child process is killed). I.e. there’s no need to let the reaper handle it. In fact, doing so leads to a crash since we will have destroyed (and thus free:d) the terminal instance when the reaper callback is called.
-rw-r--r--terminal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index ecb4e6cc..5b1d6190 100644
--- a/terminal.c
+++ b/terminal.c
@@ -1305,6 +1305,9 @@ term_shutdown(struct terminal *term)
fdm_del(term->fdm, term->blink.fd);
fdm_del(term->fdm, term->flash.fd);
+ /* We’ll deal with this explicitly */
+ reaper_del(term->reaper, term->slave);
+
if (term->window != NULL && term->window->is_configured)
fdm_del(term->fdm, term->ptmx);
else