Skip to content

Commit c7e02eb

Browse files
committed
Fix initial event for ObservableCollection and related memory leak.
1 parent def100e commit c7e02eb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ReactiveKit.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22
s.name = "ReactiveKit"
3-
s.version = "1.0.9"
3+
s.version = "1.0.10"
44
s.summary = "A Swift Reactive Programming Framework"
55
s.description = "ReactiveKit is a collection of Swift frameworks for reactive and functional reactive programming."
66
s.homepage = "https://github.com/ReactiveKit/ReactiveKit"
77
s.license = 'MIT'
88
s.author = { "Srdan Rasic" => "[email protected]" }
9-
s.source = { :git => "https://github.com/ReactiveKit/ReactiveKit.git", :tag => "v1.0.9" }
9+
s.source = { :git => "https://github.com/ReactiveKit/ReactiveKit.git", :tag => "v1.0.10" }
1010

1111
s.ios.deployment_target = '8.0'
1212
s.osx.deployment_target = '10.9'

ReactiveKit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.9</string>
18+
<string>1.0.10</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

ReactiveKit/ObservableCollection/ObservableCollection.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ public protocol ObservableCollectionType: CollectionType, StreamType {
3535

3636
public final class ObservableCollection<Collection: CollectionType>: ActiveStream<ObservableCollectionEvent<Collection>>, ObservableCollectionType {
3737

38-
private var collectionEvent: ObservableCollectionEvent<Collection>! = nil
38+
private var _collection: Collection! = nil
3939

4040
public var collection: Collection {
41-
return collectionEvent.collection
41+
return _collection
4242
}
4343

4444
public init(_ collection: Collection) {
45-
collectionEvent = ObservableCollectionEvent.initial(collection)
45+
_collection = collection
4646
super.init()
4747
}
4848

@@ -51,13 +51,13 @@ public final class ObservableCollection<Collection: CollectionType>: ActiveStrea
5151
}
5252

5353
public override func next(event: ObservableCollectionEvent<Collection>) {
54-
collectionEvent = event
54+
_collection = event.collection
5555
super.next(event)
5656
}
5757

5858
public override func observe(on context: ExecutionContext? = ImmediateOnMainExecutionContext, observer: Observer) -> DisposableType {
5959
let disposable = super.observe(on: context, observer: observer)
60-
observer(collectionEvent)
60+
observer(ObservableCollectionEvent.initial(collection))
6161
return disposable
6262
}
6363

0 commit comments

Comments
 (0)