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

2017-07-11 Thread Zhao Xin via swift-users
Glad to know the answer. And thank you, Slava and Daniel.​ Zhao Xin On Wed, Jul 12, 2017 at 7:53 AM, Daniel Dunbar wrote: > > On Jul 11, 2017, at 3:55 PM, Zhao Xin via swift-users < > swift-users@swift.org> wrote: > > For example, I have an async query, I pass it an `@escaping > resultHandler`.

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

2017-07-11 Thread Daniel Dunbar via swift-users
> On Jul 11, 2017, at 3:55 PM, Zhao Xin via swift-users > 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

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

2017-07-11 Thread Slava Pestov via swift-users
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 > 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 t

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

2017-07-11 Thread Zhao Xin via swift-users
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?