Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 8ee30ec

Browse files
committed
Merge pull request ReactiveCocoa#1608 from ReactiveCocoa/hot-signal-generator-lifetime
Keep HotSignals alive for as long as their generators are
2 parents 7121cb3 + b095cf0 commit 8ee30ec

5 files changed

Lines changed: 410 additions & 199 deletions

File tree

ReactiveCocoa/Swift/ColdSignal.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,9 +1163,11 @@ extension ColdSignal {
11631163
onError = errorHandler
11641164
}
11651165

1166-
return self.self.start(next: { value in
1166+
self.start(next: { value in
11671167
sink.put(value)
11681168
}, error: onError, completed: completionHandler)
1169+
1170+
return
11691171
}
11701172
}
11711173
}

ReactiveCocoa/Swift/FoundationExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import LlamaKit
1212
extension NSNotificationCenter {
1313
/// Returns a signal of notifications posted that match the given criteria.
1414
public func rac_notifications(name: String? = nil, object: AnyObject? = nil) -> HotSignal<NSNotification> {
15-
return HotSignal { sink in
15+
return HotSignal.weak { sink in
1616
let observer = self.addObserverForName(name, object: object, queue: nil) { notification in
1717
sink.put(notification)
1818
}

0 commit comments

Comments
 (0)