Skip to content

Commit

Permalink
Release reference to execution once future is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
jhalterman committed Mar 16, 2023
1 parent be89177 commit ae7469b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/dev/failsafe/spi/FailsafeFuture.java
Expand Up @@ -81,6 +81,7 @@ public synchronized boolean cancel(boolean mayInterruptIfRunning) {
ExecutionResult<R> result = ExecutionResult.exception(new CancellationException());
super.completeExceptionally(result.getException());
completionHandler.accept(result, newestExecution);
newestExecution = null;
return cancelResult;
}

Expand All @@ -99,6 +100,7 @@ public synchronized boolean completeResult(ExecutionResult<R> result) {
completed = super.completeExceptionally(exception);
if (completed)
completionHandler.accept(result, newestExecution);
newestExecution = null;
return completed;
}

Expand Down

0 comments on commit ae7469b

Please sign in to comment.