Преглед на файлове

Unconditionally close repository in unregisterAndCloseRepository

Repository.close() method is used when reference counting and expiration
needs to be honored. The RepositoryCache.unregisterAndCloseRepository
method should close the repository unconditionally. This is also indicated
from its javadoc.

Change-Id: I19392d1eaa17f27ae44b55eea49dcff05a52f298
tags/v4.5.0.201609210915-r
Saša Živkov преди 7 години
родител
ревизия
b7df7d1fd3
променени са 1 файла, в които са добавени 3 реда и са изтрити 5 реда
  1. 3
    5
      org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java

+ 3
- 5
org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java Целия файл

@@ -305,11 +305,9 @@ public class RepositoryCache {
private void unregisterAndCloseRepository(final Key location,
Repository db) {
synchronized (lockFor(location)) {
if (isExpired(db)) {
Repository oldDb = unregisterRepository(location);
if (oldDb != null) {
oldDb.close();
}
Repository oldDb = unregisterRepository(location);
if (oldDb != null) {
oldDb.doClose();
}
}
}

Loading…
Отказ
Запис