Skip to content

Commit

Permalink
Naive fix for switchToLatest deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
jspahrsummers committed May 23, 2015
1 parent d1e073a commit 13fe954
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ReactiveCocoa/Swift/Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1363,10 +1363,9 @@ private func switchToLatest<T, E>(signal: Signal<SignalProducer<T, E>, E>) -> Si
}

default:
state.withValue { value -> () in
if value.isLatestIncompleteSignal(innerSignal) {
sink.put(event)
}
let shouldSend = state.withValue { $0.isLatestIncompleteSignal(innerSignal) }
if shouldSend {
sink.put(event)
}
}
})
Expand Down

0 comments on commit 13fe954

Please sign in to comment.