diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-27 20:01:30 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-27 20:01:30 +0000 |
commit | 5cd1d459c5351774dbcda51911278d781384bf0f (patch) | |
tree | 8da5e09bbf78870f9ce02c80577b47c188150b17 /tty.c | |
parent | 2fabfb30b0275a0adc7b5bc0a260ab830d1f41ed (diff) | |
download | rtmux-5cd1d459c5351774dbcda51911278d781384bf0f.tar.gz rtmux-5cd1d459c5351774dbcda51911278d781384bf0f.tar.bz2 rtmux-5cd1d459c5351774dbcda51911278d781384bf0f.zip |
Three-stage exit process so that [] message printing works on detach etc.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.3 2007-11-27 19:43:50 nicm Exp $ */ +/* $Id: tty.c,v 1.4 2007-11-27 20:01:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -140,6 +140,8 @@ tty_close(struct tty *tty) tty_keys_free(tty); close(tty->fd); + tty->fd = -1; + buffer_destroy(tty->in); buffer_destroy(tty->out); } @@ -150,10 +152,14 @@ tty_free(struct tty *tty) if (tty->fd != -1) tty_close(tty); - if (tty->path != NULL) + if (tty->path != NULL) { xfree(tty->path); - if (tty->term != NULL) + tty->path = NULL; + } + if (tty->term != NULL) { xfree(tty->term); + tty->term = NULL; + } } void |