diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-16 15:17:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-16 15:17:47 -0300 |
commit | c220b0a5d099372e58e517b9f13eaa7bb0bec45c (patch) | |
tree | 5d5a083a4a7e924f5af052295cef49792305a989 /manual | |
parent | 298f383ffcc30d0799fbca0293175f647fe6bccf (diff) | |
download | lua-c220b0a5d099372e58e517b9f13eaa7bb0bec45c.tar.gz lua-c220b0a5d099372e58e517b9f13eaa7bb0bec45c.tar.bz2 lua-c220b0a5d099372e58e517b9f13eaa7bb0bec45c.zip |
'__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.
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/manual/manual.of b/manual/manual.of index 61fcdaa3..3d2fb4fb 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -1548,14 +1548,15 @@ they are closed in the reverse order that they were declared. | |||
1548 | 1548 | ||
1549 | If there is any error while running a closing method, | 1549 | If there is any error while running a closing method, |
1550 | that error is handled like an error in the regular code | 1550 | that error is handled like an error in the regular code |
1551 | where the variable was defined; | 1551 | where the variable was defined. |
1552 | in particular, | 1552 | However, Lua may call the method one more time. |
1553 | the other pending closing methods will still be called. | 1553 | |
1554 | After an error, | 1554 | After an error, |
1555 | other errors in closing methods | 1555 | the other pending closing methods will still be called. |
1556 | Errors in these methods | ||
1556 | interrupt the respective method, | 1557 | interrupt the respective method, |
1557 | but are otherwise ignored; | 1558 | but are otherwise ignored; |
1558 | the error reported is the original one. | 1559 | the error reported is only the original one. |
1559 | 1560 | ||
1560 | If a coroutine yields and is never resumed again, | 1561 | If a coroutine yields and is never resumed again, |
1561 | some variables may never go out of scope, | 1562 | some variables may never go out of scope, |