diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2011-12-02 17:38:05 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-12-02 17:38:05 -0500 |
commit | ef32ab428fcff8b69a61754dfac4b51370a28ec6 (patch) | |
tree | 96fc06c0453ab9835d297764196e96c41f4053ee | |
parent | 9fc04272e6a9f90a5e291cc59fed7b99fb106fb5 (diff) | |
parent | 0d61707f12b5b1a94b325fc8c2975a9e60a14dac (diff) | |
download | jgit-ef32ab428fcff8b69a61754dfac4b51370a28ec6.tar.gz jgit-ef32ab428fcff8b69a61754dfac4b51370a28ec6.zip |
Merge "Always close the GZIPOutputStream to release Deflater"
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java index 00cb67ca95..c39b78900d 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartOutputStream.java @@ -101,8 +101,11 @@ class SmartOutputStream extends TemporaryBuffer { TemporaryBuffer gzbuf = new TemporaryBuffer.Heap(LIMIT); try { GZIPOutputStream gzip = new GZIPOutputStream(gzbuf); - out.writeTo(gzip, null); - gzip.close(); + try { + out.writeTo(gzip, null); + } finally { + gzip.close(); + } if (gzbuf.length() < out.length()) { out = gzbuf; rsp.setHeader(HDR_CONTENT_ENCODING, ENCODING_GZIP); |