Suppose I have a simple call dispatch_async(self.queue, ^{ /* Empty */ })
, where self.queue
is a queue created previously.
Does self
get retained by the Block in this case, given that there is no self
reference inside the block, but only as a parameter for dispatch_async()
?
Ok, so apple docs states that
The queue is retained by the system until the block has run to completion.
So the queue will be retained by the system until the block completes the execution, but the self
won't be retained in this case.
Thanks to @Wain for pointing out my mistake in the previous version of this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With