From 546cc36d79d0ed104b95304922cf331fd0ca2f4b Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 24 Dec 2019 13:23:45 -0600 Subject: [PATCH] fix: avoid completing future twise --- chronos/asyncloop.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chronos/asyncloop.nim b/chronos/asyncloop.nim index 68cd5417..6fee7045 100644 --- a/chronos/asyncloop.nim +++ b/chronos/asyncloop.nim @@ -855,7 +855,7 @@ proc wait*[T](fut: Future[T], timeout = InfiniteDuration): Future[T] = proc continuation(udata: pointer) {.gcsafe.} = if not(retFuture.finished()): - if isNil(udata): + if not(fut.finished()): # Timer exceeded first. fut.removeCallback(continuation) fut.cancel()