systray: Turn this into a singleton
There's no point in having multiple instances of this, because there are no per-instance settings and the systray can only be visible in a single place at a time anyway. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
ab408103ee
commit
ea95963726
|
@ -90,8 +90,12 @@ local function new(revers)
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local instance
|
||||||
function systray.mt:__call(...)
|
function systray.mt:__call(...)
|
||||||
return new(...)
|
if not instance then
|
||||||
|
instance = new(...)
|
||||||
|
end
|
||||||
|
return instance
|
||||||
end
|
end
|
||||||
|
|
||||||
return setmetatable(systray, systray.mt)
|
return setmetatable(systray, systray.mt)
|
||||||
|
|
Loading…
Reference in New Issue