What is the correct way to release a GCD dispatch queue property?

后端 未结 4 950
耶瑟儿~
耶瑟儿~ 2021-02-18 19:18

I\'m using a dispatch_queue which is accessed through a property of its owner, like this:

@property (nonatomic, assign) dispatch_queue_t queue;

4条回答
  •  一整个雨季
    2021-02-18 20:01

    What happens if there is stuff pending/running on the queue while calling release?

    It is safe. pending/running queue is retained from system. Calling dispatch_release just affects the retain count of the queue. See man page of dispatch_async or so forth.

提交回复
热议问题