diff --git a/chronos/internal/asyncfutures.nim b/chronos/internal/asyncfutures.nim index d0842520..d364dc55 100644 --- a/chronos/internal/asyncfutures.nim +++ b/chronos/internal/asyncfutures.nim @@ -734,8 +734,8 @@ proc `and`*[T, Y](fut1: Future[T], fut2: Future[Y]): Future[void] {. retFuture.fail(fut2.error) else: retFuture.complete() - fut1.callback = cb - fut2.callback = cb + fut1.addCallback(cb) + fut2.addCallback(cb) proc cancellation(udata: pointer) = # On cancel we remove all our callbacks only. @@ -1086,12 +1086,14 @@ proc allFutures*(futs: varargs[FutureBase]): Future[void] {. inc(finishedFutures) if finishedFutures == totalFutures: retFuture.complete() + reset(nfuts) proc cancellation(udata: pointer) = # On cancel we remove all our callbacks only. for i in 0..