Skip to content

Commit

Permalink
fix : add synchronized on the returned list when traversing it Splite…
Browse files Browse the repository at this point in the history
…rator
  • Loading branch information
jubatusd committed Mar 21, 2024
1 parent 0f90909 commit 0272bdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/java/overflowdb/ReferenceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ private void safelyClearReferences(final List<NodeRef> refsToClear) {
* useful when saving the graph
*/
public void clearAllReferences() {
nodesWriter.writeAndClearBatched(clearableRefs.spliterator(), clearableRefs.size());
logger.debug("cleared all clearable references");
synchronized (clearableRefs){
nodesWriter.writeAndClearBatched(clearableRefs.spliterator(), clearableRefs.size());
logger.debug("cleared all clearable references");
}
}

@Override
Expand Down

0 comments on commit 0272bdb

Please sign in to comment.