Skip to content
Snippets Groups Projects
Commit 1584b1eb authored by dg's avatar dg
Browse files

Stop garbage collection while saving, this might avoid a nasty crash

git-svn-id: http://svn.net-core.org/repos/t-engine4@1169 51575b47-30f0-44d4-a5cc-537603b46e54
parent b2f8e31f
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,8 @@ end
-- Do not call this, this is automatic!
function _M:doThread()
self.saving = true
collectgarbage("collect")
collectgarbage("stop")
if game:getPlayer() then game:getPlayer().changed = true end
while #self.pipe > 0 do
local p = self.pipe[1]
......@@ -83,6 +85,7 @@ function _M:doThread()
table.remove(self.pipe, 1)
end
if game.log then game.log("Saving done.") end
collectgarbage("restart")
self.saving = false
if game:getPlayer() then game:getPlayer().changed = true end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment