Commits

Sebastian Sdorra committed 731ed18

release open RevWalk instances

Comments (0)

Files changed (2)

scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitHookChangesetCollector.java

     finally
     {
       IOUtil.close(converter);
+      GitUtil.release(walk);
     }
 
     return changesets;

scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/spi/GitLogCommand.java

     Changeset changeset = null;
     Repository gr = null;
     GitChangesetConverter converter = null;
+    RevWalk revWalk = null;
 
     try
     {
 
       if (!gr.getAllRefs().isEmpty())
       {
-        RevWalk revWalk = new RevWalk(gr);
+        revWalk = new RevWalk(gr);
         ObjectId id = GitUtil.getRevisionId(gr, revision);
         RevCommit commit = revWalk.parseCommit(id);
 
     finally
     {
       IOUtil.close(converter);
+      GitUtil.release(revWalk);
       GitUtil.close(gr);
     }
 
 
     ChangesetPagingResult changesets = null;
     GitChangesetConverter converter = null;
+    RevWalk revWalk = null;
 
     try
     {
           endId = gr.resolve(request.getEndChangeset());
         }
 
-        RevWalk revWalk = new RevWalk(gr);
+        revWalk = new RevWalk(gr);
 
         converter = new GitChangesetConverter(gr, revWalk);
 
     finally
     {
       IOUtil.close(converter);
+      GitUtil.release(revWalk);
     }
 
     return changesets;