diff --git a/event.c b/event.c index 676c96ba5..27cb8f234 100644 --- a/event.c +++ b/event.c @@ -409,7 +409,7 @@ event_handle_keypress(void *data __attribute__ ((unused)), else { keybinding_t *k = keybinding_find(&globalconf.keys, ev); - if (k && k->fct) + if (k && k->fct != LUA_REFNIL) luaA_dofunction(globalconf.L, k->fct, 0); } diff --git a/keybinding.c b/keybinding.c index 7a16121df..c34065ef5 100644 --- a/keybinding.c +++ b/keybinding.c @@ -41,6 +41,7 @@ void keybinding_idx_wipe(keybinding_idx_t *idx) void keybinding_delete(keybinding_t **kbp) { + luaL_unref(globalconf.L, LUA_REGISTRYINDEX, (*kbp)->fct); p_delete(kbp); }