Skip to content

Commit

Permalink
Fixes #13. Delegates are now set on the correct delegate queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmurfin committed Feb 1, 2021
1 parent ffbed4e commit ad94c13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Sources/OTPKit/Components/Consumer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ final public class OTPConsumer: Component {
*/
public func setConsumerDelegate(_ delegate: OTPConsumerDelegate?) {
Self.queue.sync(flags: .barrier) {
delegateQueue.sync {
self.consumerDelegate = delegate
}
}
Expand All @@ -134,7 +134,7 @@ final public class OTPConsumer: Component {
*/
public func setProtocolErrorDelegate(_ delegate: OTPComponentProtocolErrorDelegate?) {
Self.queue.sync(flags: .barrier) {
delegateQueue.sync {
self.protocolErrorDelegate = delegate
}
}
Expand All @@ -147,7 +147,7 @@ final public class OTPConsumer: Component {
*/
public func setDebugDelegate(_ delegate: OTPComponentDebugDelegate?) {
Self.queue.sync(flags: .barrier) {
delegateQueue.sync {
self.debugDelegate = delegate
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/OTPKit/Components/Producer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ final public class OTPProducer: Component {
*/
public func setProducerDelegate(_ delegate: OTPProducerDelegate?) {
Self.queue.sync(flags: .barrier) {
delegateQueue.sync {
self.producerDelegate = delegate
}
}
Expand All @@ -153,7 +153,7 @@ final public class OTPProducer: Component {
*/
public func setProtocolErrorDelegate(_ delegate: OTPComponentProtocolErrorDelegate?) {
Self.queue.sync(flags: .barrier) {
delegateQueue.sync {
self.protocolErrorDelegate = delegate
}
}
Expand All @@ -166,7 +166,7 @@ final public class OTPProducer: Component {
*/
public func setDebugDelegate(_ delegate: OTPComponentDebugDelegate?) {
Self.queue.sync(flags: .barrier) {
delegateQueue.sync {
self.debugDelegate = delegate
}
}
Expand Down

0 comments on commit ad94c13

Please sign in to comment.