diff --git a/button.c b/button.c index ab318643..0efc2824 100644 --- a/button.c +++ b/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; diff --git a/client.c b/client.c index ec1d5651..111d4562 100644 --- a/client.c +++ b/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); diff --git a/image.c b/image.c index 1454f275..d36a74a2 100644 --- a/image.c +++ b/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); diff --git a/key.c b/key.c index 6b426751..6460e38f 100644 --- a/key.c +++ b/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; diff --git a/tag.c b/tag.c index 1fb1cfe5..96589d5e 100644 --- a/tag.c +++ b/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; diff --git a/wibox.c b/wibox.c index 0b1e3164..48cf3dc9 100644 --- a/wibox.c +++ b/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); diff --git a/widget.c b/widget.c index f8c00e3d..e48bfe28 100644 --- a/widget.c +++ b/widget.c @@ -44,6 +44,7 @@ static int luaA_widget_gc(lua_State *L) { widget_t *widget = luaL_checkudata(L, 1, "widget"); + luaA_ref_array_wipe(&widget->refs); if(widget->destructor) widget->destructor(widget); button_array_wipe(&widget->buttons);