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
This commit is contained in:
parent
aadbb158e1
commit
b7df7d1fd3
|
@ -305,11 +305,9 @@ private boolean isExpired(Repository db) {
|
||||||
private void unregisterAndCloseRepository(final Key location,
|
private void unregisterAndCloseRepository(final Key location,
|
||||||
Repository db) {
|
Repository db) {
|
||||||
synchronized (lockFor(location)) {
|
synchronized (lockFor(location)) {
|
||||||
if (isExpired(db)) {
|
Repository oldDb = unregisterRepository(location);
|
||||||
Repository oldDb = unregisterRepository(location);
|
if (oldDb != null) {
|
||||||
if (oldDb != null) {
|
oldDb.doClose();
|
||||||
oldDb.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue