diff options
author | Shawn Pearce <spearce@spearce.org> | 2015-05-28 15:35:25 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2015-05-28 15:35:26 -0400 |
commit | 10b99121b06f4a4a16e410dc905a6c7dd669caf9 (patch) | |
tree | d9fe87204d8f68c50ad49986e75419e48bad4d4d | |
parent | ff75f18f0765f0a76d600bb456faa079d906ea80 (diff) | |
parent | 27128b3e01a9c97f1d2549ded0d381f469f0aee8 (diff) | |
download | jgit-10b99121b06f4a4a16e410dc905a6c7dd669caf9.tar.gz jgit-10b99121b06f4a4a16e410dc905a6c7dd669caf9.zip |
Merge "Fix WindowCursor memory leak."
6 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java index 05055644ec..cb80768e51 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java @@ -123,7 +123,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { @After public void tearDown() throws Exception { if (wc != null) - wc.release(); + wc.close(); new WindowCacheConfig().install(); super.tearDown(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java index 10d2b6b526..8c8c6c6d0c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java @@ -108,7 +108,7 @@ public class UnpackedObjectTest extends LocalDiskRepositoryTestCase { @After public void tearDown() throws Exception { if (wc != null) - wc.release(); + wc.close(); new WindowCacheConfig().install(); super.tearDown(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInputStream.java index 9cb834957a..154809bad8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInputStream.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInputStream.java @@ -80,6 +80,6 @@ class PackInputStream extends InputStream { @Override public void close() { - wc.release(); + wc.close(); } }
\ No newline at end of file diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java index cb95a76563..cb7d912593 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java @@ -95,7 +95,7 @@ public class UnpackedObject { try { return open(new ByteArrayInputStream(raw), null, id, wc); } finally { - wc.release(); + wc.close(); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java index 3e6cb58358..a555e10d47 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java @@ -330,7 +330,8 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs { } /** Release the current window cursor. */ - public void release() { + @Override + public void close() { window = null; baseCache = null; try { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java index 4c9af85fa8..77cfb038cc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java @@ -430,7 +430,5 @@ public abstract class ObjectReader implements AutoCloseable { * @since 4.0 */ @Override - public void close() { - // Do nothing. - } + public abstract void close(); } |