Fix callback leak

This commit is contained in:
buffet 2019-12-31 00:25:20 +00:00
parent 9fb2b2ce43
commit 006c73b47a

View file

@ -37,6 +37,8 @@ l_lua_callback_cancel(lua_State *L)
wl_list_remove(&lc->listener.link); wl_list_remove(&lc->listener.link);
wl_list_remove(&lc->link); wl_list_remove(&lc->link);
luaL_unref(L, LUA_REGISTRYINDEX, lc->callback_ref);
free(lc); free(lc);
return 0; return 0;
@ -300,6 +302,8 @@ luaK_fini(struct kiwmi_lua *lua)
wl_list_remove(&lc->listener.link); wl_list_remove(&lc->listener.link);
wl_list_remove(&lc->link); wl_list_remove(&lc->link);
luaL_unref(lua->L, LUA_REGISTRYINDEX, lc->callback_ref);
free(lc); free(lc);
} }