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

Cf. <https://github.com/koreader/koreader/pull/7044>.
reviewable/pr7048/r2
Frans de Jonge 3 years ago committed by GitHub
parent 21af9144ab
commit 53909db687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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

Loading…
Cancel
Save