Release any ObjectReaders created by JGit
RevWalk implicitly creates an ObjectReader if you call its Repository based constructor. Ensure we always release those ObjectReaders, or use our own that we can release when we are done. Change-Id: I6421507d248e331e7c35bdeb7831ea2f7bcff6b5 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -79,9 +79,13 @@ public class PatchSetInfoFactory {
|
||||
final String projectName = projectKey.get();
|
||||
repo = repoManager.openRepository(projectName);
|
||||
final RevWalk rw = new RevWalk(repo);
|
||||
final RevCommit src =
|
||||
rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get()));
|
||||
return get(src, patchSetId);
|
||||
try {
|
||||
final RevCommit src =
|
||||
rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get()));
|
||||
return get(src, patchSetId);
|
||||
} finally {
|
||||
rw.release();
|
||||
}
|
||||
} catch (OrmException e) {
|
||||
throw new PatchSetInfoNotAvailableException(e);
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user