fix(#1804): do not refresh watched nodes that have been destroyed (deleted)

This commit is contained in:
Alexander Courtis
2022-12-19 14:36:42 +11:00
parent e0cfbbb93d
commit d949af7245
4 changed files with 11 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ function M.create_watcher(node)
local function callback(watcher)
log.line("watcher", "node event scheduled refresh %s", watcher.context)
utils.debounce(watcher.context, M.debounce_delay, function()
if watcher.destroyed then
return
end
if node.link_to then
log.line("watcher", "node event executing refresh '%s' -> '%s'", node.link_to, node.absolute_path)
else