mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
luaref: fix leaks for global luarefs
This commit is contained in:
parent
5ed383057b
commit
eae4b1e5c2
@ -594,6 +594,10 @@ void nlua_free_all_mem(void)
|
|||||||
if (!global_lstate) {
|
if (!global_lstate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
lua_State *lstate = global_lstate;
|
||||||
|
|
||||||
|
nlua_unref(lstate, nlua_nil_ref);
|
||||||
|
nlua_unref(lstate, nlua_empty_dict_ref);
|
||||||
|
|
||||||
#ifdef NLUA_TRACK_REFS
|
#ifdef NLUA_TRACK_REFS
|
||||||
if (nlua_refcount) {
|
if (nlua_refcount) {
|
||||||
@ -604,7 +608,7 @@ void nlua_free_all_mem(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nlua_refcount = 0;
|
nlua_refcount = 0;
|
||||||
lua_close(global_lstate);
|
lua_close(lstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nlua_print_event(void **argv)
|
static void nlua_print_event(void **argv)
|
||||||
|
Loading…
Reference in New Issue
Block a user