summaryrefslogtreecommitdiff
path: root/volume-widget
diff options
context:
space:
mode:
Diffstat (limited to 'volume-widget')
-rw-r--r--volume-widget/volume.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua
index 4c44042..b689f6e 100644
--- a/volume-widget/volume.lua
+++ b/volume-widget/volume.lua
@@ -143,7 +143,9 @@ local function build_header_row(text)
end
local function rebuild_popup()
+ local reset_garbage_collector = 0
spawn.easy_async(LIST_DEVICES_CMD, function(stdout)
+ reset_garbage_collector = reset_garbage_collector + 1
local sinks, sources = utils.extract_sinks_and_sources(stdout)
@@ -155,6 +157,11 @@ local function rebuild_popup()
table.insert(rows, build_rows(sources, function() rebuild_popup() end, "source"))
popup:setup(rows)
+
+ if (reset_garbage_collector > 10) then
+ collectgarbage()
+ reset_garbage_collector = 0
+ end
end)
end