Clean queues
This commit is contained in:
parent
7a01b6a2a4
commit
f9b656986c
@ -244,6 +244,14 @@ public class LMDBArray<V> implements IArray<V>, Closeable {
|
||||
public void close() throws IOException {
|
||||
if (closed.compareAndSet(false, true)) {
|
||||
ensureThread();
|
||||
for (ByteBuf toWriteKey : toWriteKeys) {
|
||||
toWriteKey.release();
|
||||
}
|
||||
for (ByteBuf toWriteValue : toWriteValues) {
|
||||
toWriteValue.release();
|
||||
}
|
||||
toWriteKeys.clear();
|
||||
toWriteValues.clear();
|
||||
if (rwTxn != null) {
|
||||
rwTxn.close();
|
||||
}
|
||||
|
@ -498,6 +498,14 @@ public class LMDBPriorityQueue<T> implements PriorityQueue<T>, Reversable<Revers
|
||||
public void close() throws IOException {
|
||||
if (closed.compareAndSet(false, true)) {
|
||||
ensureThread();
|
||||
for (ByteBuf toWriteKey : toWriteKeys) {
|
||||
toWriteKey.release();
|
||||
}
|
||||
for (ByteBuf toWriteValue : toWriteValues) {
|
||||
toWriteValue.release();
|
||||
}
|
||||
toWriteKeys.clear();
|
||||
toWriteValues.clear();
|
||||
if (cur != null) {
|
||||
cur.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user