lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



> On 30 May 2019, at 17:45, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> 
>> The manual states: "If a coroutine yields inside a block and is never resumed again, the variables visible at that block will never go out of scope, and therefore they will not be closed.”
>> 
>> Since this is quite explicitly mentioned, I’m confused as to what will happen when I let go of a suspended coroutine and it gets garbage collected? Will the __close handlers be called or not in that case? Maybe some clarification would be justified here.
>> 
> 
> The manual says "they will not be closed". Why isn't that clear?
> 
> -- Roberto
> 

"If a coroutine yields inside a block and is never resumed again, ”

I’d make it more specific with

"If a coroutine yields inside a block and is never resumed again (even if the coroutine is garbage collected), “

Thijs