diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-11-11 10:57:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-11 10:57:16 +0100 |
commit | 5d653a134464fe06c488dd67071359b04e90949e (patch) | |
tree | 0ea641168deeac2a84f424a0fafcd5cb0ad90673 /src/nvim/api/vim.c | |
parent | 0ecc58c2775ae576a3325aec163aa1018aad9e0a (diff) | |
parent | 8b5c32c8cd9b76aaefa0977a69789fa9bd43f2fd (diff) | |
download | rneovim-5d653a134464fe06c488dd67071359b04e90949e.tar.gz rneovim-5d653a134464fe06c488dd67071359b04e90949e.tar.bz2 rneovim-5d653a134464fe06c488dd67071359b04e90949e.zip |
Merge pull request #16276 from zeertzjq/channel-closed-term-error
Fixes and tests for sending to terminal channel whose terminal has been deleted
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 2fbafb9889..c1374ff00e 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1006,7 +1006,6 @@ Integer nvim_open_term(Buffer buffer, DictionaryOf(LuaRef) opts, Error *err) Terminal *term = terminal_open(buf, topts); terminal_check_size(term); chan->term = term; - channel_incref(chan); return (Integer)chan->id; } @@ -1036,6 +1035,8 @@ static void term_close(void *data) Channel *chan = data; terminal_destroy(chan->term); chan->term = NULL; + api_free_luaref(chan->stream.internal.cb); + chan->stream.internal.cb = LUA_NOREF; channel_decref(chan); } |