From c8bc9ee37c28d3c67fd3b5afb6c66d6af6003b3a Mon Sep 17 00:00:00 2001 From: chrox Date: Sun, 17 Aug 2014 17:38:33 +0800 Subject: [PATCH] close screen framebuffer when exiting reader --- frontend/ui/device/screen.lua | 5 +++++ frontend/ui/uimanager.lua | 2 +- reader.lua | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/ui/device/screen.lua b/frontend/ui/device/screen.lua index 414d2420b..788162dd1 100644 --- a/frontend/ui/device/screen.lua +++ b/frontend/ui/device/screen.lua @@ -239,6 +239,11 @@ function Screen:restoreFromBB(bb) end end +function Screen:close() + DEBUG("close screen framebuffer") + self.fb:close() +end + function Screen:getDPIMenuTable() local function dpi() return G_reader_settings:readSetting("screen_dpi") end local function custom() return G_reader_settings:readSetting("custom_screen_dpi") end diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 0a4f5306c..74d8df49f 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -358,7 +358,7 @@ function UIManager:run() -- stop when we have no window to show if #self._window_stack == 0 then - DEBUG("no dialog left to show, would loop endlessly") + DEBUG("no dialog left to show") self:quit() return nil end diff --git a/reader.lua b/reader.lua index 19c58ecfa..b36fb1974 100755 --- a/reader.lua +++ b/reader.lua @@ -38,8 +38,6 @@ function exitReader() G_reader_settings:close() - input.closeAll() - -- Close lipc handles KindlePowerD:coda() ReaderActivityIndicator:coda() @@ -64,6 +62,9 @@ function exitReader() end end + input.closeAll() + Screen:close() + if Profiler then Profiler.stop() end os.exit(0) end