diff --git a/Sources/Relays/PassthroughRelay.swift b/Sources/Relays/PassthroughRelay.swift index f6e1231..555e706 100644 --- a/Sources/Relays/PassthroughRelay.swift +++ b/Sources/Relays/PassthroughRelay.swift @@ -74,6 +74,7 @@ private extension PassthroughRelay { func forceFinish() { self.sink?.shouldForwardCompletion = true self.sink?.receive(completion: .finished) + self.sink = nil } func request(_ demand: Subscribers.Demand) { @@ -81,7 +82,7 @@ private extension PassthroughRelay { } func cancel() { - sink = nil + forceFinish() } } }