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:
Uli Schlachter 2011-04-14 22:40:56 +02:00
parent b530da1861
commit d436b2845c
1 changed files with 2 additions and 2 deletions

View File

@ -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)