Skip to content

Commit

Permalink
Ensure that calling cancel() deallocates the subscription (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusficner committed Mar 28, 2022
1 parent fe8ee35 commit 5bc3dbc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/CombineLongPolling/LongPollingPublisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ extension LongPollingPublisher {
lock.lock()
finished = true
lock.unlock()
// Make sure to not wait for the semaphore, otherwise the object won't get allocated
semaphore.signal()

buffer?.complete(completion: .finished)
currentRequest = nil
Expand Down

0 comments on commit 5bc3dbc

Please sign in to comment.