Close Lua state on all os.exit() calls (#7050)

Cf. <https://github.com/koreader/koreader/pull/7044>.
This commit is contained in:
Frans de Jonge
2020-12-25 16:19:16 +01:00
committed by GitHub
parent 21af9144ab
commit 53909db687
2 changed files with 2 additions and 2 deletions

View File

@@ -823,7 +823,7 @@ function Input:waitEvent(timeout_us)
break
elseif ev == "application forced to quit" then
--- @todo return an event that can be handled
os.exit(0)
os.exit(0, true)
end
logger.warn("got error waiting for events:", ev)
if ev ~= "Waiting for input failed: 4\n" then

View File

@@ -1278,7 +1278,7 @@ function UIManager:handleInput()
io.stderr:write(debug.traceback() .. "\n")
io.stderr:flush()
self.looper:close()
os.exit(1)
os.exit(1, true)
end)
end)
end