Main: Move the G_reader_settings flush to Device:exit

I don't trust PB's input.closeAll not to be doing something wonky that
would trip an early abort.
This commit is contained in:
NiLuJe
2023-08-19 13:34:50 +02:00
parent d1bbdb5dad
commit 21de1a832e
2 changed files with 7 additions and 5 deletions

View File

@@ -545,8 +545,13 @@ function Device:exit()
-- Restore initial HW inversion state
self.screen:setHWNightmode(self.orig_hw_nightmode)
-- I/O teardown
-- Tear down the fb backend
self.screen:close()
-- Flush settings to disk
G_reader_settings:close()
-- I/O teardown
require("ffi/input"):closeAll()
end

View File

@@ -292,12 +292,9 @@ end
-- Exit
local function exitReader()
-- Shutdown hardware abstraction
-- Shutdown hardware abstraction (it'll also flush G_reader_settings to disk)
Device:exit()
-- Flush settings to disk
G_reader_settings:close()
if Profiler then Profiler.stop() end
if type(exit_code) == "number" then