hwhw/kindlepdfviewer — pull request #626 by chrox (2012-11-21 11:04:29+00:00)
Title: bugfix: calculate current cache size and free oldest cache if needed

Cache ttl should not be decreased only when there is no free slot for
new cache but decreased when claiming new cache each time. Otherwise
caches will be freed altogether which obviously is not the purpose of
the cache system. This patch only free the oldest caches and make just
enough free slots for the new one.