Browse Source

Merge "Fix WindowCursor memory leak."

stable-4.1
Shawn Pearce 10 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
10b99121b0
  1. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java
  2. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/UnpackedObjectTest.java
  3. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackInputStream.java
  4. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java
  5. 3
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java
  6. 4
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java

2
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();
}

2
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();
}

2
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();
}
}

2
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();
}
}

3
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 {

4
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();
}

Loading…
Cancel
Save