Skip to content

Commit e413147

Browse files
committed
Ensure lock is activated when editing subscriptions
1 parent bdb3b23 commit e413147

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/Subjects/ReplaySubject.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public final class ReplaySubject<Output, Failure: Error>: Subject {
7272
}
7373

7474
subscriptions.forEach { $0.forwardCompletionToBuffer(completion) }
75+
76+
lock.lock()
77+
defer { self.lock.unlock() }
7578
self.subscriptions.removeAll()
7679
}
7780

0 commit comments

Comments
 (0)