mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
PocketBook: Run Generic:exit *last*
Makes more sense this way. Re: #10828 Also clarify the UIManager "no dialogs left" message, and drop the return value, as it's meaningless, we just want to break & return.
This commit is contained in:
@@ -257,18 +257,18 @@ function PocketBook:init()
|
||||
end
|
||||
|
||||
function PocketBook:exit()
|
||||
Generic.exit(self)
|
||||
|
||||
-- Exit code can be shoddy on some devices due to broken library dtors calling _exit(0) from os.exit(N)
|
||||
local ko_exit = os.getenv("KO_EXIT_CODE")
|
||||
if ko_exit then
|
||||
local fo = io.open(ko_exit, "w+")
|
||||
if fo then
|
||||
local f = io.open(ko_exit, "w+")
|
||||
if f then
|
||||
-- As returned by UIManager:run() in reader.lua
|
||||
fo:write(tostring(UIManager._exit_code))
|
||||
fo:close()
|
||||
f:write(tostring(UIManager._exit_code))
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
|
||||
Generic.exit(self)
|
||||
end
|
||||
|
||||
function PocketBook:notifyBookState(title, document)
|
||||
|
||||
@@ -39,6 +39,7 @@ local UIManager = {
|
||||
_refresh_func_stack = {},
|
||||
_entered_poweroff_stage = false,
|
||||
_exit_code = nil,
|
||||
_gated_quit = nil,
|
||||
_prevent_standby_count = 0,
|
||||
_prev_prevent_standby_count = 0,
|
||||
|
||||
@@ -1448,9 +1449,9 @@ function UIManager:handleInput()
|
||||
|
||||
-- stop when we have no window to show
|
||||
if not self._window_stack[1] then
|
||||
logger.info("no dialog left to show")
|
||||
logger.info("UIManager: No dialogs left to show")
|
||||
if self:_gated_quit() ~= false then
|
||||
return nil
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user