In an app I'm working on for a client I create several concurrent dispatch queues at startup and then add long-running tasks to them using dispatch_async.
When the app gets ready to shut down, I set a global quit variable that causes the long-running tasks to exit their run loops, do final cleanup and exit.
I also set the (strong) variables that I use to keep track of my dispatch queues to nil. According to the docs, in ARC, dispatch queues are managed by ARC so I should not need to call dispatch_release on them once I am done with them.
Blocks running on the dispatch queues also hold owning references to their queues, but I've checked and all the blocks exit as expected shortly after I set the global quit variable.
I added __weak variables pointing to my dispatch queues, and several seconds after setting my quit flag and nil-ing out my strong references, I check the values in the weak variables. They should be nil because there should not be any more owning references to my queues. However, they don't go nil, and displaying them in the debugger shows a reference count of 1.
Has anybody else encountered this problem? I've gone over the code carefully and I don't see any block capturing problems. It's a client app that I'm doing as work for hire so I can't really post the code here unfortunately.