diff options
Diffstat (limited to 'src/nvim/channel.c')
-rw-r--r-- | src/nvim/channel.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c index 30243a3102..313eefd562 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -8,6 +8,7 @@ #include "nvim/eval/encode.h" #include "nvim/event/socket.h" #include "nvim/fileio.h" +#include "nvim/lua/executor.h" #include "nvim/msgpack_rpc/channel.h" #include "nvim/msgpack_rpc/server.h" #include "nvim/os/shell.h" @@ -87,7 +88,7 @@ bool channel_close(uint64_t id, ChannelPart part, const char **error) break; case kChannelStreamProc: - proc = (Process *)&chan->stream.proc; + proc = &chan->stream.proc; if (part == kChannelPartStdin || close_main) { stream_may_close(&proc->in); } @@ -136,6 +137,8 @@ bool channel_close(uint64_t id, ChannelPart part, const char **error) *error = (const char *)e_invstream; return false; } + api_free_luaref(chan->stream.internal.cb); + chan->stream.internal.cb = LUA_NOREF; break; default: @@ -335,7 +338,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout, CallbackReader chan->stream.uv = libuv_process_init(&main_loop, chan); } - Process *proc = (Process *)&chan->stream.proc; + Process *proc = &chan->stream.proc; proc->argv = argv; proc->cb = channel_process_exit_cb; proc->events = chan->events; @@ -420,6 +423,7 @@ uint64_t channel_connect(bool tcp, const char *address, bool rpc, CallbackReader // Create a loopback channel. This avoids deadlock if nvim connects to // its own named pipe. channel = channel_alloc(kChannelStreamInternal); + channel->stream.internal.cb = LUA_NOREF; rpc_start(channel); goto end; } |