mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-22 10:37:15 +08:00
Wraps transaction async dispatches with autorelease pools.
This commit is contained in:
@@ -87,12 +87,14 @@
|
||||
ASDisplayNodeAsyncTransactionOperation *operation = [[ASDisplayNodeAsyncTransactionOperation alloc] initWithOperationCompletionBlock:completion];
|
||||
[_operations addObject:operation];
|
||||
dispatch_group_async(_group, queue, ^{
|
||||
if (_state != ASAsyncTransactionStateCanceled) {
|
||||
dispatch_group_enter(_group);
|
||||
block(^(id<NSObject> value){
|
||||
operation.value = value;
|
||||
dispatch_group_leave(_group);
|
||||
});
|
||||
@autoreleasepool {
|
||||
if (_state != ASAsyncTransactionStateCanceled) {
|
||||
dispatch_group_enter(_group);
|
||||
block(^(id<NSObject> value){
|
||||
operation.value = value;
|
||||
dispatch_group_leave(_group);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -109,8 +111,10 @@
|
||||
ASDisplayNodeAsyncTransactionOperation *operation = [[ASDisplayNodeAsyncTransactionOperation alloc] initWithOperationCompletionBlock:completion];
|
||||
[_operations addObject:operation];
|
||||
dispatch_group_async(_group, queue, ^{
|
||||
if (_state != ASAsyncTransactionStateCanceled) {
|
||||
operation.value = block();
|
||||
@autoreleasepool {
|
||||
if (_state != ASAsyncTransactionStateCanceled) {
|
||||
operation.value = block();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user