diff --git a/client.c b/client.c index 2ad09059e..f1a41926b 100644 --- a/client.c +++ b/client.c @@ -52,6 +52,7 @@ luaA_client_gc(lua_State *L) { client_t *c = luaL_checkudata(L, 1, "client"); button_array_wipe(&c->buttons); + key_array_wipe(&c->keys); image_unref(L, c->icon); p_delete(&c->class); p_delete(&c->startup_id); diff --git a/key.c b/key.c index 8b84a1395..f30d33279 100644 --- a/key.c +++ b/key.c @@ -33,13 +33,12 @@ LUA_OBJECT_FUNCS(keyb_t, key, "key") -static void +void key_unref_simplified(keyb_t **b) { key_unref(globalconf.L, *b); } -ARRAY_FUNCS(keyb_t *, key, key_unref_simplified) DO_LUA_TOSTRING(keyb_t, key, "key") /** Garbage collect a key. diff --git a/key.h b/key.h index f5d987d06..972f77ec9 100644 --- a/key.h +++ b/key.h @@ -39,7 +39,9 @@ typedef struct keyb_t luaA_ref release; } keyb_t; -ARRAY_TYPE(keyb_t *, key) +void key_unref_simplified(keyb_t **); + +DO_ARRAY(keyb_t *, key, key_unref_simplified) bool key_press_lookup_string(xcb_keysym_t, char *, ssize_t); xcb_keysym_t key_getkeysym(xcb_keycode_t, uint16_t);