Skip to content

Commit 1051692

Browse files
committed
always remove holder when unloading
1 parent e8d1749 commit 1051692

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nouveau/src/main/java/org/apache/couchdb/nouveau/core/IndexManager.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ public void unload(final String name, final boolean forceDelete) throws IOExcept
188188
}
189189
holder.state = HolderState.UNLOADED;
190190
holder.index = null;
191-
synchronized (cache) {
192-
cache.remove(name, holder);
193-
}
194191
break;
195192
case NOT_LOADED:
196193
case UNLOADED:
@@ -200,6 +197,9 @@ public void unload(final String name, final boolean forceDelete) throws IOExcept
200197
break;
201198
}
202199
} finally {
200+
synchronized (cache) {
201+
cache.remove(name, holder);
202+
}
203203
holder.lock.writeLock().unlock();
204204
}
205205
}

0 commit comments

Comments
 (0)