                     break
                 }
             }
-            storage.continuation = continuation
             build(Continuation(continuation))
         }
         storage.stream = stream

                    continuation.finish(throwing: error)
                }
            }
            continuation.onTermination = { [weak storage] in
                switch $0 {
                case .cancelled:

        let storage = Storage()
        storage.onTermination = onTermination
        let stream = AsyncThrowingStream<Element, Error>(Element.self, bufferingPolicy: .bufferingNewest(bufferSize)) { continuation in
            storage.continuation = continuation
            continuation.onTermination = { [weak storage] in
                switch $0 {
                case .cancelled:
