[swift-users] Is there any harm that an @escaping handler never called?

Slava Pestov spestov at apple.com
Tue Jul 11 18:41:49 CDT 2017


No, there is no requirement to invoke a closure at least once, escaping or not.

Slava

> On Jul 11, 2017, at 3:55 PM, Zhao Xin via swift-users <swift-users at swift.org> wrote:
> 
> For example, I have an async query, I pass it an `@escaping resultHandler`. If there is any results, the handler will run. However, if the result is empty, the `@escaping resultHandler` will never run.
> 
> Is there any memory leak or something will happen if the `@escaping resultHandler` never runs?
> 
> Zhao Xin
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170711/af3e2a22/attachment.html>


More information about the swift-users mailing list