Use weak keys for referring to screens
This commit changes some tables that are used for per-screen stuff to have weak keys, so that the screens can be garbage-collected, if needed. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
0d4cc5f43a
commit
fc390ff405
|
@ -47,7 +47,7 @@ function layoutbox.new(screen)
|
|||
|
||||
-- Do we already have the update callbacks registered?
|
||||
if boxes == nil then
|
||||
boxes = setmetatable({}, { __mode = "v" })
|
||||
boxes = setmetatable({}, { __mode = "kv" })
|
||||
tag.attached_connect_signal(nil, "property::selected", update_from_tag)
|
||||
tag.attached_connect_signal(nil, "property::layout", update_from_tag)
|
||||
layoutbox.boxes = boxes
|
||||
|
|
|
@ -175,7 +175,7 @@ function taglist.new(screen, filter, buttons, style, update_function, base_widge
|
|||
end
|
||||
end
|
||||
if instances == nil then
|
||||
instances = {}
|
||||
instances = setmetatable({}, { __mode = "k" })
|
||||
local function u(s)
|
||||
local i = instances[get_screen(s)]
|
||||
if i then
|
||||
|
|
|
@ -190,7 +190,7 @@ function tasklist.new(screen, filter, buttons, style, update_function, base_widg
|
|||
data[c] = nil
|
||||
end
|
||||
if instances == nil then
|
||||
instances = {}
|
||||
instances = setmetatable({}, { __mode = "k" })
|
||||
local function us(s)
|
||||
local i = instances[get_screen(s)]
|
||||
if i then
|
||||
|
|
Loading…
Reference in New Issue