mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8303742: CompletableFuture.orTimeout leaks if the future completes exceptionally
Reviewed-by: jpai, alanb
This commit is contained in:
parent
652bda0af8
commit
ded6a81319
2 changed files with 64 additions and 1 deletions
|
@ -2937,7 +2937,7 @@ public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
|
|||
final Future<?> f;
|
||||
Canceller(Future<?> f) { this.f = f; }
|
||||
public void accept(Object ignore, Throwable ex) {
|
||||
if (ex == null && f != null && !f.isDone())
|
||||
if (f != null && !f.isDone())
|
||||
f.cancel(false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue