diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-27 20:27:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-27 20:27:40 +0800 |
commit | b6f384e930448d5259ec100117bd752802c21c7c (patch) | |
tree | 52dc2d157b950bd1a2076081d257207fddc87830 /script/files.lua | |
parent | a02af642109e7bad6c34f34055d900a9f9fa31f4 (diff) | |
download | lua-language-server-b6f384e930448d5259ec100117bd752802c21c7c.zip |
fix file ref counts
Diffstat (limited to 'script/files.lua')
-rw-r--r-- | script/files.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/script/files.lua b/script/files.lua index 0cbfe2ce..b01f02e6 100644 --- a/script/files.lua +++ b/script/files.lua @@ -419,8 +419,8 @@ function m.addRef(uri) if not file then return nil end - file._ref = (file._ref or 0) + 1 - log.debug('add ref', uri, file._ref) + file.ref = (file.ref or 0) + 1 + log.debug('add ref', uri, file.ref) return function () m.delRef(uri) end @@ -431,9 +431,9 @@ function m.delRef(uri) if not file then return end - file._ref = (file._ref or 0) - 1 - log.debug('del ref', uri, file._ref) - if file._ref <= 0 and not m.isOpen(uri) then + file.ref = (file.ref or 0) - 1 + log.debug('del ref', uri, file.ref) + if file.ref <= 0 and not m.isOpen(uri) then m.remove(uri) end end |