diff --git a/src/ttynvt.c b/src/ttynvt.c index 9e567eb..d427cc3 100644 --- a/src/ttynvt.c +++ b/src/ttynvt.c @@ -141,15 +141,16 @@ static void ttynvt_release(fuse_req_t req, struct fuse_file_info *info) DBG("%s\n", __func__); tty->rel_pending = 1; - _fd_close(tty->fds[FD_NET].fd); - _fd_close(tty->fds[FD_MASTER].fd); - _fd_close(tty->fds[FD_SLAVE].fd); pthread_cancel(tty->ptid_poll); pthread_join(tty->ptid_poll, NULL); pthread_mutex_destroy(&tty->tty_lock); pthread_mutex_destroy(&tty->poll_lock); + _fd_close(tty->fds[FD_NET].fd); + _fd_close(tty->fds[FD_MASTER].fd); + _fd_close(tty->fds[FD_SLAVE].fd); + if (tty->ph) fuse_pollhandle_destroy(tty->ph);