mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
ReaderView: Make sure we unschedule the hinting task on actual teardown.
onCloseDocument is way too early, if another, later onCloseDocument handler trips a ReaderUI repaint, a new task will be scheduled, and that one will never be cancelled, resulting in it running post-teardown, crashing horribly. This was for instance very easy to trigger via KOSync. Fix #10806
This commit is contained in:
@@ -51,6 +51,7 @@ local ReaderView = OverlapGroup:extend{
|
||||
-- Crengine view mode
|
||||
view_mode = G_defaults:readSetting("DCREREADER_VIEW_MODE"), -- default to page mode
|
||||
hinting = true,
|
||||
emitHintPageEvent = nil,
|
||||
|
||||
-- visible area within current viewing page
|
||||
visible_area = nil,
|
||||
@@ -1107,9 +1108,10 @@ function ReaderView:getRenderModeMenuTable()
|
||||
}
|
||||
end
|
||||
|
||||
function ReaderView:onCloseDocument()
|
||||
-- stop any pending HintPage event
|
||||
function ReaderView:onCloseWidget()
|
||||
-- Stop any pending HintPage event
|
||||
UIManager:unschedule(self.emitHintPageEvent)
|
||||
self.emitHintPageEvent = nil
|
||||
end
|
||||
|
||||
function ReaderView:onReaderReady()
|
||||
|
||||
Reference in New Issue
Block a user