mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD. * Purge broken on-disk cache files * Optimize free RAM computations * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents. * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one. * Use more accurate item size estimations across the whole codebase. TileCacheItem: * Drop lua-serialize in favor of Persist. KoptInterface: * Drop lua-serialize in favor of Persist. * Make KOPTContext caching actually work by ensuring its hash is stable.
This commit is contained in:
@@ -733,13 +733,13 @@ function ReaderUI:onClose(full_refresh)
|
||||
if self.dialog ~= self then
|
||||
self:saveSettings()
|
||||
end
|
||||
-- serialize last used items for later launch
|
||||
Cache:serialize()
|
||||
if self.document ~= nil then
|
||||
logger.dbg("closing document")
|
||||
self:notifyCloseDocument()
|
||||
end
|
||||
UIManager:close(self.dialog, full_refresh and "full")
|
||||
-- serialize last used items for later launch
|
||||
Cache:serialize()
|
||||
if _running_instance == self then
|
||||
_running_instance = nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user