Skip to content

Commit

Permalink
Make self weak in disposable.
Browse files Browse the repository at this point in the history
  • Loading branch information
roberthein committed Mar 20, 2018
1 parent 645aa69 commit 898dc28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Observable.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Observable'
s.version = '1.3.2'
s.version = '1.3.3'
s.ios.deployment_target = '8.0'
s.summary = 'The easiest way to observe values in Swift'
s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions Observable/Classes/Observable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public final class Observable<T> {
observers[id] = observer
observer(value, nil)

let disposable = Disposable {
self.observers[id] = nil
let disposable = Disposable { [weak self] in
self?.observers[id] = nil
}

return disposable
Expand Down

0 comments on commit 898dc28

Please sign in to comment.