summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/files/files.lua6
-rw-r--r--server/src/service.lua14
2 files changed, 8 insertions, 12 deletions
diff --git a/server/src/files/files.lua b/server/src/files/files.lua
index 31e5e21b..ed56483c 100644
--- a/server/src/files/files.lua
+++ b/server/src/files/files.lua
@@ -86,6 +86,12 @@ function mt:clear()
self._library = {}
end
+function mt:clearVM()
+ for _, f in pairs(self._files) do
+ f:removeVM()
+ end
+end
+
function mt:eachFile()
return pairs(self._files)
end
diff --git a/server/src/service.lua b/server/src/service.lua
index 16c1f549..d88753f1 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -312,13 +312,7 @@ function mt:reCompile()
end
local compiled = {}
- local needCompile = {}
- for uri in self._files:eachFile() do
- needCompile[uri] = true
- end
-
- self._files:clear()
-
+ self._files:clearVM()
for _, obj in pairs(listMgr.list) do
if obj.type == 'source' or obj.type == 'function' then
@@ -332,11 +326,7 @@ function mt:reCompile()
self.globalValue = nil
self._compileTask:remove()
self._needCompile = {}
- for uri, buf in self._files:eachOpened() do
- self:readText(uri, uric.decode(uri), buf, compiled)
- self:needCompile(uri, compiled)
- end
- for uri in pairs(needCompile) do
+ for uri in self._files:eachFile() do
self:needCompile(uri, compiled)
end