Skip to content

Commit

Permalink
fix(terminal): free terminal if close_buffer() closes a closed terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
zeertzjq committed Nov 9, 2021
1 parent 8cbe100 commit 0bdf849
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nvim/terminal.c
Expand Up @@ -262,6 +262,9 @@ Terminal *terminal_open(buf_T *buf, TerminalOptions opts)
void terminal_close(Terminal *term, int status)
{
if (term->closed) {
if (status == -1 && !term->refcount) {
terminal_destroy(term);
}
return;
}

Expand Down

0 comments on commit 0bdf849

Please sign in to comment.