Clear readers' cache: invalidate in-memory references

This avoids crash on exit after clearing caches.
This commit is contained in:
poire-z authored and Qingping Hou committed 2016-12-14 11:39:46 -08:00
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,