From d832b8c9b8807ba731b4c9b8844ba77ace23035e Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 7 Aug 2019 02:33:07 -0400 Subject: [PATCH] layoutlist: Use weak tables to store the cache. --- lib/awful/widget/layoutlist.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/widget/layoutlist.lua b/lib/awful/widget/layoutlist.lua index 6cb3ff18e..8458cebb1 100644 --- a/lib/awful/widget/layoutlist.lua +++ b/lib/awful/widget/layoutlist.lua @@ -327,7 +327,7 @@ function layoutlist:set_widget_template(widget_template) self._private.widget_template = widget_template -- Remove the existing instances - self._private.data = {} + self._private.data = setmetatable({}, { __mode = 'k' }) -- Prevent a race condition when the constructor loop to initialize the -- arguments. @@ -403,7 +403,7 @@ local function new(_, args) ret._private.style = args.style or {} ret._private.buttons = args.buttons ret._private.source = args.source - ret._private.data = {} + ret._private.data = setmetatable({}, { __mode = 'k' }) reload_cache(ret)