From 9118ead5ae15548c8a5b96340f9a0a24b3104e32 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 10 May 2016 16:03:37 -0400 Subject: make terms handle cleaning themselves up --- src/pty-unix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/pty-unix.c') diff --git a/src/pty-unix.c b/src/pty-unix.c index 7975964..27419ce 100644 --- a/src/pty-unix.c +++ b/src/pty-unix.c @@ -94,6 +94,8 @@ void runes_pty_backend_spawn_subprocess(RunesTerm *t) fprintf(old_stderr, "Couldn't run %s: %s\n", cmd, strerror(errno)); exit(1); } + + runes_term_refcnt_inc(t); } void runes_pty_backend_init_loop(RunesTerm *t, RunesLoop *loop) @@ -155,7 +157,10 @@ static int runes_pty_backend_got_data(void *t) return 1; } else { + runes_pty_backend_cleanup(pty); + free(pty); runes_window_backend_request_close(t); + runes_term_refcnt_dec(t); return 0; } -- cgit v1.2.3-54-g00ecf