aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-16 15:17:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-16 15:17:47 -0300
commitc220b0a5d099372e58e517b9f13eaa7bb0bec45c (patch)
tree5d5a083a4a7e924f5af052295cef49792305a989 /manual
parent298f383ffcc30d0799fbca0293175f647fe6bccf (diff)
downloadlua-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.of11
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
1549If there is any error while running a closing method, 1549If there is any error while running a closing method,
1550that error is handled like an error in the regular code 1550that error is handled like an error in the regular code
1551where the variable was defined; 1551where the variable was defined.
1552in particular, 1552However, Lua may call the method one more time.
1553the other pending closing methods will still be called. 1553
1554After an error, 1554After an error,
1555other errors in closing methods 1555the other pending closing methods will still be called.
1556Errors in these methods
1556interrupt the respective method, 1557interrupt the respective method,
1557but are otherwise ignored; 1558but are otherwise ignored;
1558the error reported is the original one. 1559the error reported is only the original one.
1559 1560
1560If a coroutine yields and is never resumed again, 1561If a coroutine yields and is never resumed again,
1561some variables may never go out of scope, 1562some variables may never go out of scope,