/** Garbage collect a tag. * \param L The Lua VM state. * \return 0. */ static int luaA_tag_gc(lua_State *L) { tag_t *tag = luaA_checkudata(L, 1, &tag_class); client_array_wipe(&tag->clients); p_delete(&tag->name); return luaA_object_gc(L); }
/** Collect a widget structure. * \param L The Lua VM state. * \return 0 */ static int luaA_widget_gc(lua_State *L) { widget_t *widget = luaA_checkudata(L, 1, &widget_class); if(widget->destructor) widget->destructor(widget); button_array_wipe(&widget->buttons); return luaA_object_gc(L); }