diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 12:29:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 12:29:03 +0800 |
commit | cfd9939902ae0f2050b0d02ab923abf53743c967 (patch) | |
tree | 2f9128c85032278481a0107eb0dd765e5caba673 /server | |
parent | b2c1a69f74823d3481076e5def02e45a22eae4ef (diff) | |
download | lua-language-server-cfd9939902ae0f2050b0d02ab923abf53743c967.zip |
修正一处内存泄漏
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/value.lua | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/server/src/core/value.lua b/server/src/core/value.lua index 5426815f..53d5c749 100644 --- a/server/src/core/value.lua +++ b/server/src/core/value.lua @@ -195,15 +195,20 @@ function mt:eachField(callback, mark, stack) end function mt:removeUri(uri) - if not self._child then - return + if self._child then + self._child[uri] = nil + self:rawEachField(function (field) + if field.value then + field.value:removeUri(uri) + end + end) + end + if self._info then + self._info[uri] = nil + end + if self._meta then + self._meta[uri] = nil end - self._child[uri] = nil - self:rawEachField(function (field) - if field.value then - field.value:removeUri(uri) - end - end) end function mt:getDeclarat() |