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 4477dd82ad
commit c89bec9ff9
3 changed files with 5 additions and 3 deletions

View File

@ -53,6 +53,7 @@ luaA_client_gc(lua_State *L)
client_t *c = luaL_checkudata(L, 1, "client");
luaA_ref_array_wipe(&c->refs);
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

@ -40,7 +40,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);