'__close' method may be called again in case of error
An error in a closing method may be caused by a lack of resources, such as memory or stack space, and the error may free enough resources (by unwinding the stack) to allow the method to work if called again. If the closing method is already running after some error (including its own), it is not called again.
This commit is contained in:
@@ -1548,14 +1548,15 @@ they are closed in the reverse order that they were declared.
|
||||
|
||||
If there is any error while running a closing method,
|
||||
that error is handled like an error in the regular code
|
||||
where the variable was defined;
|
||||
in particular,
|
||||
the other pending closing methods will still be called.
|
||||
where the variable was defined.
|
||||
However, Lua may call the method one more time.
|
||||
|
||||
After an error,
|
||||
other errors in closing methods
|
||||
the other pending closing methods will still be called.
|
||||
Errors in these methods
|
||||
interrupt the respective method,
|
||||
but are otherwise ignored;
|
||||
the error reported is the original one.
|
||||
the error reported is only the original one.
|
||||
|
||||
If a coroutine yields and is never resumed again,
|
||||
some variables may never go out of scope,
|
||||
|
||||
Reference in New Issue
Block a user