Clear readers' cache: invalidate in-memory references
This avoids crash on exit after clearing caches.
This commit is contained in:
1 parent
65881738b5
commit
fe56ecd301
1 file changed
+8
@@ -213,6 +213,14 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
purgeDir(cachedir)
|
||||
end
|
||||
lfs.mkdir(cachedir)
|
||||
-- Also remove from Cache objet references to
|
||||
-- the cache files we just deleted
|
||||
local Cache = require("cache")
|
||||
Cache.cached = {}
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
UIManager:show(InfoMessage:new{
|
||||
text = _("Caches cleared. Please exit and restart KOReader."),
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
||||
Reference in new issue
Block a user