Do I need to release the block which passed to the dispatchbarrierasync when no ARC ? I noticed "The barrier block to submit to the target dispatch queue. This block is copied and retained until it finishes executing, at which point it is released." in dispatchbarrierasync.
Thanks!
Code Block dispatch_block_t work = dispatch_block_create(0, ^{ //... }); if (work) { dispatch_barrier_async(_dispatchQueue, work); auto res = dispatch_block_wait(work, timeout); if (res) { // timeout, then cancel, I should release work here? dispatch_block_cancel(work); } Block_release(work); // do I need to release work when no ARC? the dispatch_barrier_async would release it if it's executed? } }
Thanks!