Fix the wrong declaration of SDCallbackQueue's block, should be escaping to match GCD block
This may cause the wrong lifecycle for block (earily release)
This commit is contained in:
parent
554e05a441
commit
5bb64eae39
|
@ -45,10 +45,10 @@ typedef NS_ENUM(NSUInteger, SDCallbackPolicy) {
|
|||
|
||||
/// Submits a block for execution and returns after that block finishes executing.
|
||||
/// - Parameter block: The block that contains the work to perform.
|
||||
- (void)sync:(nonnull NS_NOESCAPE dispatch_block_t)block;
|
||||
- (void)sync:(nonnull dispatch_block_t)block;
|
||||
|
||||
/// Schedules a block asynchronously for execution.
|
||||
/// - Parameter block: The block that contains the work to perform.
|
||||
- (void)async:(nonnull NS_NOESCAPE dispatch_block_t)block;
|
||||
- (void)async:(nonnull dispatch_block_t)block;
|
||||
|
||||
@end
|
||||
|
|
|
@ -79,7 +79,7 @@ static void inline SDSafeExecute(dispatch_queue_t _Nonnull queue, dispatch_block
|
|||
return queue;
|
||||
}
|
||||
|
||||
- (void)sync:(nonnull NS_NOESCAPE dispatch_block_t)block {
|
||||
- (void)sync:(nonnull dispatch_block_t)block {
|
||||
switch (self.policy) {
|
||||
case SDCallbackPolicySafeExecute:
|
||||
SDSafeExecute(self.queue, block, NO);
|
||||
|
@ -93,7 +93,7 @@ static void inline SDSafeExecute(dispatch_queue_t _Nonnull queue, dispatch_block
|
|||
}
|
||||
}
|
||||
|
||||
- (void)async:(nonnull NS_NOESCAPE dispatch_block_t)block {
|
||||
- (void)async:(nonnull dispatch_block_t)block {
|
||||
switch (self.policy) {
|
||||
case SDCallbackPolicySafeExecute:
|
||||
SDSafeExecute(self.queue, block, YES);
|
||||
|
|
Loading…
Reference in New Issue