diff --git a/chronos/asyncsync.nim b/chronos/asyncsync.nim index 0be29ea0..b352a895 100644 --- a/chronos/asyncsync.nim +++ b/chronos/asyncsync.nim @@ -37,7 +37,7 @@ type ## state to be signaled, when event get fired, then all coroutines ## continue proceeds in order, they have entered waiting state. flag: bool - waiters*: seq[Future[void]] + waiters: seq[Future[void]] AsyncQueue*[T] = ref object of RootRef ## A queue, useful for coordinating producer and consumer coroutines. diff --git a/chronos/transports/stream.nim b/chronos/transports/stream.nim index c14746dc..aae041d7 100644 --- a/chronos/transports/stream.nim +++ b/chronos/transports/stream.nim @@ -1639,7 +1639,9 @@ proc close*(server: StreamServer) = ## Please note that release of resources is not completed immediately, to be ## sure all resources got released please use ``await server.join()``. proc continuation(udata: pointer) {.gcsafe.} = - server.clean() + # Stop tracking server + if not(server.loopFuture.finished()): + server.clean() let r1 = (server.status == ServerStatus.Stopped) and not(isNil(server.function))