From: Niki Roo Date: Mon, 22 Apr 2019 10:34:04 +0000 (+0200) Subject: Download: make sure to close in when caching X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=eb6dcdbff86d9f55acae34af6f7d828ff0056aed;p=fanfix-jexer.git Download: make sure to close in when caching --- diff --git a/src/be/nikiroo/utils/Downloader.java b/src/be/nikiroo/utils/Downloader.java index 1ec4379..30ce4e7 100644 --- a/src/be/nikiroo/utils/Downloader.java +++ b/src/be/nikiroo/utils/Downloader.java @@ -336,8 +336,11 @@ public class Downloader { if (in != null && cache != null) { tracer.trace("Save to cache: " + originalUrl); try { - cache.save(in, originalUrl); - in.close(); + try { + cache.save(in, originalUrl); + } finally { + in.close(); + } in = cache.load(originalUrl, true, false); } catch (IOException e) { tracer.error(new IOException(