diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-11-13 19:21:07 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 19:21:07 -0600 |
commit | 582d7f47905d82f315dc852a9d2937cd5b655e55 (patch) | |
tree | 2a8b82a0bb4e7079dc6c5be33f00c360e9547c6b /src/nvim/lua/executor.c | |
parent | 28f4f3c48498086307ed825d1761edb5789ca0e8 (diff) | |
parent | 22eb2ba18336df6cd70a88f666818ee5d8ba92d2 (diff) | |
download | rneovim-582d7f47905d82f315dc852a9d2937cd5b655e55.tar.gz rneovim-582d7f47905d82f315dc852a9d2937cd5b655e55.tar.bz2 rneovim-582d7f47905d82f315dc852a9d2937cd5b655e55.zip |
Merge pull request #25918 from gpanders/background-color
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 716fe5e481..aed96a539a 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -366,6 +366,12 @@ static void nlua_schedule_event(void **argv) static int nlua_schedule(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL { + // If Nvim is exiting don't schedule tasks to run in the future. Any refs + // allocated here will not be cleaned up otherwise + if (exiting) { + return 0; + } + if (lua_type(lstate, 1) != LUA_TFUNCTION) { lua_pushliteral(lstate, "vim.schedule: expected function"); return lua_error(lstate); |