diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-03-27 10:41:42 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2021-04-03 16:27:58 +0200 |
commit | eae4b1e5c2b68206b0cdff17129458bec0a28c25 (patch) | |
tree | e7b6fa5a272df02cb2b4c94a8f498dc30f0e3bf7 | |
parent | 5ed383057b5272d3777d2179128f474cc31317ea (diff) | |
download | rneovim-eae4b1e5c2b68206b0cdff17129458bec0a28c25.tar.gz rneovim-eae4b1e5c2b68206b0cdff17129458bec0a28c25.tar.bz2 rneovim-eae4b1e5c2b68206b0cdff17129458bec0a28c25.zip |
luaref: fix leaks for global luarefs
-rw-r--r-- | src/nvim/lua/executor.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index d4c6e8e02e..4274520e01 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -594,6 +594,10 @@ void nlua_free_all_mem(void) if (!global_lstate) { return; } + lua_State *lstate = global_lstate; + + nlua_unref(lstate, nlua_nil_ref); + nlua_unref(lstate, nlua_empty_dict_ref); #ifdef NLUA_TRACK_REFS if (nlua_refcount) { @@ -604,7 +608,7 @@ void nlua_free_all_mem(void) #endif nlua_refcount = 0; - lua_close(global_lstate); + lua_close(lstate); } static void nlua_print_event(void **argv) |