leak test: Make the layoutbox test pass
This commit does two things: It gets rid of the reference to the layoutbox that the default config created and it changes the widget dependency cache to not keep widgets alive unnecessarily. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
abc5a552a4
commit
bd47edb4ef
|
@ -18,7 +18,7 @@ local base = {}
|
||||||
-- {{{ Caches
|
-- {{{ Caches
|
||||||
|
|
||||||
-- Indexes are widgets, allow them to be garbage-collected
|
-- Indexes are widgets, allow them to be garbage-collected
|
||||||
local widget_dependencies = setmetatable({}, { __mode = "k" })
|
local widget_dependencies = setmetatable({}, { __mode = "kv" })
|
||||||
|
|
||||||
-- Get the cache of the given kind for this widget. This returns a gears.cache
|
-- Get the cache of the given kind for this widget. This returns a gears.cache
|
||||||
-- that calls the callback of kind `kind` on the widget.
|
-- that calls the callback of kind `kind` on the widget.
|
||||||
|
|
|
@ -10,6 +10,12 @@ local errors = {}
|
||||||
|
|
||||||
local prepare_for_collect = nil
|
local prepare_for_collect = nil
|
||||||
|
|
||||||
|
-- Make the layoutbox in the default config GC'able
|
||||||
|
mywibox[1].visible = false
|
||||||
|
mywibox = nil
|
||||||
|
mylayoutbox = nil
|
||||||
|
awesome.emit_signal("refresh")
|
||||||
|
|
||||||
-- Test if some objects can be garbage collected
|
-- Test if some objects can be garbage collected
|
||||||
local function collectable(a, b, c, d, e, f, g, h, last)
|
local function collectable(a, b, c, d, e, f, g, h, last)
|
||||||
assert(last == nil, "got more arguments than supported")
|
assert(last == nil, "got more arguments than supported")
|
||||||
|
|
Loading…
Reference in New Issue