Cleanup tag history on screen removal
The tag history kept a strong reference to a screen even after that screen was removed. This prevented the garbage collector from cleaning up. Fix this by getting rid of the tag history on screen removal. Related-to: https://github.com/awesomeWM/awesome/issues/2983#issuecomment-584249568 Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
dc98eade3b
commit
38a2a524a7
|
@ -1676,6 +1676,7 @@ capi.screen.connect_signal("removed", function(s)
|
||||||
t.data.awful_tag_properties.screen = nil
|
t.data.awful_tag_properties.screen = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
data.history[s] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function tag.mt:__call(...)
|
function tag.mt:__call(...)
|
||||||
|
|
|
@ -81,6 +81,16 @@ collectable(awful.widget.tasklist{screen=1, filter=awful.widget.tasklist.filter.
|
||||||
prepare_for_collect = run_delayed_calls
|
prepare_for_collect = run_delayed_calls
|
||||||
collectable(create_wibox())
|
collectable(create_wibox())
|
||||||
|
|
||||||
|
-- Test that screens can be collected
|
||||||
|
local function create_and_remove_screen()
|
||||||
|
local s = screen.fake_add(-10, -10, 10, 10)
|
||||||
|
awful.tag.viewnext(s)
|
||||||
|
s:fake_remove()
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
prepare_for_collect = run_delayed_calls
|
||||||
|
collectable(create_and_remove_screen())
|
||||||
|
|
||||||
runner.run_steps({ function() return true end })
|
runner.run_steps({ function() return true end })
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue