mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix a few possible crashes
- TextWidget: avoid crash with small max_width (could happen
when opening menu on a small emulator window)
- TextWidget: avoid crash if re-used after :free()
- ReaderHighlight:clear(): fix possible crash when
scheduled and run after document closed
- DictQuickLookup: minor canSearch() tweak ('selected_text'
is normally available only on multiple words selection,
but is currently available on single word selection thanks
to some unrelated side effect)
This commit is contained in:
@@ -379,6 +379,10 @@ function ReaderHighlight:clear(clear_id)
|
||||
end
|
||||
end
|
||||
self.clear_id = nil -- invalidate id
|
||||
if not self.ui.document then
|
||||
-- might happen if scheduled and run after document is closed
|
||||
return
|
||||
end
|
||||
if self.ui.document.info.has_pages then
|
||||
self.view.highlight.temp = {}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user