client: fix key array leak

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-06-22 17:18:06 +02:00
parent df20e95f82
commit 39efa6eb18
3 changed files with 5 additions and 3 deletions

View File

@ -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);

3
key.c
View File

@ -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.

4
key.h
View File

@ -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);