fix: avoid completing future twise

This commit is contained in:
Dmitriy Ryajov 2019-12-24 13:23:45 -06:00
parent c39c069680
commit 546cc36d79
1 changed files with 1 additions and 1 deletions

View File

@ -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()