mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Close lipc handles on exit.
No idea if bad things happen if we don't, but at least this sounds more correct. (re #696)
This commit is contained in:
@@ -45,4 +45,10 @@ function ReaderActivityIndicator:onStopActivityIndicator()
|
||||
return true
|
||||
end
|
||||
|
||||
function ReaderActivityIndicator:coda()
|
||||
if self.lipc_handle then
|
||||
self.lipc_handle:close()
|
||||
end
|
||||
end
|
||||
|
||||
return ReaderActivityIndicator
|
||||
|
||||
@@ -8,7 +8,7 @@ local KindlePowerD = BasePowerD:new{
|
||||
kt_kpw_capacity = "/sys/devices/system/yoshi_battery/yoshi_battery0/battery_capacity",
|
||||
kpw_charging = "/sys/devices/platform/aplite_charger.0/charging",
|
||||
kt_charging = "/sys/devices/platform/fsl-usb2-udc/charging",
|
||||
|
||||
|
||||
flIntensity = nil,
|
||||
battCapacity = nil,
|
||||
is_charging = nil,
|
||||
@@ -26,9 +26,9 @@ end
|
||||
function KindlePowerD:init(model)
|
||||
local lipc = require("liblipclua")
|
||||
if lipc then
|
||||
self.lipc_handle = lipc.init("com.github.koreader")
|
||||
self.lipc_handle = lipc.init("com.github.koreader.kindlepowerd")
|
||||
end
|
||||
|
||||
|
||||
if model == "KindleTouch" then
|
||||
self.batt_capacity_file = self.kt_kpw_capacity
|
||||
self.is_charging_file = self.kt_charging
|
||||
@@ -83,4 +83,10 @@ function KindlePowerD:isChargingHW()
|
||||
return self.is_charging == 1
|
||||
end
|
||||
|
||||
function KindlePowerD:coda()
|
||||
if self.lipc_handle then
|
||||
self.lipc_handle:close()
|
||||
end
|
||||
end
|
||||
|
||||
return KindlePowerD
|
||||
|
||||
@@ -30,6 +30,8 @@ local InfoMessage = require("ui/widget/infomessage")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local Menu = require("ui/widget/menu")
|
||||
local Device = require("ui/device")
|
||||
local KindlePowerD = require("ui/device/kindlepowerd")
|
||||
local ReaderActivityIndicator = require("apps/reader/modules/readeractivityindicator")
|
||||
local Screen = require("ui/screen")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
@@ -42,6 +44,10 @@ function exitReader()
|
||||
|
||||
input.closeAll()
|
||||
|
||||
-- Close lipc handles
|
||||
KindlePowerD:coda()
|
||||
ReaderActivityIndicator:coda()
|
||||
|
||||
if not util.isEmulated() then
|
||||
if Device:isKindle3() or (Device:getModel() == "KindleDXG") then
|
||||
-- send double menu key press events to trigger screen refresh
|
||||
|
||||
Reference in New Issue
Block a user