Skip to content

Commit

Permalink
Update QueryResults.java
Browse files Browse the repository at this point in the history
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放

fix apache#1639
  • Loading branch information
z7658329 authored Nov 10, 2021
1 parent 927a991 commit fea140e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ private Set<Id> queryIds() {
}

public static <T> ListIterator<T> toList(Iterator<T> iterator) {
return new ListIterator<>(Query.DEFAULT_CAPACITY, iterator);
try {
return new ListIterator<>(Query.DEFAULT_CAPACITY, iterator);
} finally {
CloseableIterator.closeIterator(iterator);
}
}

public static <T> void fillList(Iterator<T> iterator, List<T> list) {
Expand Down

0 comments on commit fea140e

Please sign in to comment.