beautiful: Use weak references for tracking fonts
There is no point in keeping this font cache alive for longer than needed. Letting lua garbage-collect fonts should provide sane cache-behavior in that we forgot about the font once no one uses it anymore. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
b530da1861
commit
d436b2845c
|
@ -27,8 +27,8 @@ module("beautiful")
|
|||
|
||||
-- Local data
|
||||
local theme
|
||||
local descs = {}
|
||||
local fonts = {}
|
||||
local descs = setmetatable({}, { __mode = 'k' })
|
||||
local fonts = setmetatable({}, { __mode = 'v' })
|
||||
local active_font
|
||||
|
||||
local function load_font(name)
|
||||
|
|
Loading…
Reference in New Issue