luaa: fix memory leak in __gc
We need to wipe the ref_array. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
3849e6d747
commit
43902aed69
1
button.c
1
button.c
|
@ -40,6 +40,7 @@ static int
|
|||
luaA_button_gc(lua_State *L)
|
||||
{
|
||||
button_t *button = luaL_checkudata(L, 1, "button");
|
||||
luaA_ref_array_wipe(&button->refs);
|
||||
luaL_unref(globalconf.L, LUA_REGISTRYINDEX, button->press);
|
||||
luaL_unref(globalconf.L, LUA_REGISTRYINDEX, button->release);
|
||||
return 0;
|
||||
|
|
1
client.c
1
client.c
|
@ -51,6 +51,7 @@ static int
|
|||
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);
|
||||
image_unref(L, c->icon);
|
||||
p_delete(&c->class);
|
||||
|
|
1
image.c
1
image.c
|
@ -28,6 +28,7 @@ static int
|
|||
luaA_image_gc(lua_State *L)
|
||||
{
|
||||
image_t *p = luaL_checkudata(L, 1, "image");
|
||||
luaA_ref_array_wipe(&p->refs);
|
||||
imlib_context_set_image(p->image);
|
||||
imlib_free_image();
|
||||
p_delete(&p->data);
|
||||
|
|
1
key.c
1
key.c
|
@ -50,6 +50,7 @@ static int
|
|||
luaA_key_gc(lua_State *L)
|
||||
{
|
||||
keyb_t *kbp = luaL_checkudata(L, 1, "key");
|
||||
luaA_ref_array_wipe(&kbp->refs);
|
||||
luaL_unref(globalconf.L, LUA_REGISTRYINDEX, kbp->press);
|
||||
luaL_unref(globalconf.L, LUA_REGISTRYINDEX, kbp->release);
|
||||
return 0;
|
||||
|
|
1
tag.c
1
tag.c
|
@ -41,6 +41,7 @@ static int
|
|||
luaA_tag_gc(lua_State *L)
|
||||
{
|
||||
tag_t *tag = luaL_checkudata(L, 1, "tag");
|
||||
luaA_ref_array_wipe(&tag->refs);
|
||||
client_array_wipe(&tag->clients);
|
||||
p_delete(&tag->name);
|
||||
return 0;
|
||||
|
|
1
wibox.c
1
wibox.c
|
@ -39,6 +39,7 @@ static int
|
|||
luaA_wibox_gc(lua_State *L)
|
||||
{
|
||||
wibox_t *wibox = luaL_checkudata(L, 1, "wibox");
|
||||
luaA_ref_array_wipe(&wibox->refs);
|
||||
p_delete(&wibox->cursor);
|
||||
simplewindow_wipe(&wibox->sw);
|
||||
button_array_wipe(&wibox->buttons);
|
||||
|
|
Loading…
Reference in New Issue