Clear readers' cache: invalidate in-memory references

This avoids crash on exit after clearing caches.
pull/2427/head
poire-z 7 years ago committed by Qingping Hou
parent 65881738b5
commit fe56ecd301

@ -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,

Loading…
Cancel
Save