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:
+2
-1
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user