Fix callback leak
This commit is contained in:
parent
3a5ed32a6c
commit
eda1fc566d
1 changed files with 4 additions and 0 deletions
|
@ -37,6 +37,8 @@ l_lua_callback_cancel(lua_State *L)
|
|||
wl_list_remove(&lc->listener.link);
|
||||
wl_list_remove(&lc->link);
|
||||
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, lc->callback_ref);
|
||||
|
||||
free(lc);
|
||||
|
||||
return 0;
|
||||
|
@ -300,6 +302,8 @@ luaK_fini(struct kiwmi_lua *lua)
|
|||
wl_list_remove(&lc->listener.link);
|
||||
wl_list_remove(&lc->link);
|
||||
|
||||
luaL_unref(lua->L, LUA_REGISTRYINDEX, lc->callback_ref);
|
||||
|
||||
free(lc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue