Merge pull request #1030 from chrox/fix_1028

fix #1028
pull/1031/head
Qingping Hou 10 years ago
commit 64bd71aa71

@ -1 +1 @@
Subproject commit 1c0cf8963b19068679b19ef52ebffd0ffafae627
Subproject commit 3ff07f9a05f3b075798b67a15aa0881733e2751d

@ -69,8 +69,8 @@ end
function Cache:insert(key, object)
-- guarantee that we have enough memory in cache
if(object.size > self.max_memsize) then
-- we're not allowed to claim this much at all
error("too much memory claimed")
DEBUG("too much memory claimed for", key)
return
end
-- delete objects that least recently used
-- (they are at the end of the cache_order array)

@ -148,9 +148,11 @@ function CreDocument:getCoverPageImage()
local data, size = self._document:getCoverPageImageData()
if data and size then
local Mupdf = require("ffi/mupdf")
local image = Mupdf.renderImage(data, size)
ffi.C.free(data)
return image
local ok, image = pcall(Mupdf.renderImage, data, size)
if ok then
ffi.C.free(data)
return image
end
end
end

Loading…
Cancel
Save