Ensure project rescan thread is terminated

When changing a project we need to ensure that the old threads
are no longer run.
This commit is contained in:
Francesco Abbate 2022-01-08 17:15:09 +01:00
parent 1520c12580
commit 39366d3a09
1 changed files with 2 additions and 1 deletions

View File

@ -369,13 +369,14 @@ end
local function add_dir_scan_thread(dir) local function add_dir_scan_thread(dir)
core.add_thread(function() core.add_thread(function()
while true do while true do
print("DEBUG: running rescan on", dir.name)
local has_changes = rescan_project_subdir(dir, "") local has_changes = rescan_project_subdir(dir, "")
if has_changes then if has_changes then
core.redraw = true -- we run without an event, from a thread core.redraw = true -- we run without an event, from a thread
end end
coroutine.yield(5) coroutine.yield(5)
end end
end) end, dir)
end end