Don't swallow errors in finalizers.
This commit is contained in:
parent
9ffd96724d
commit
9fe38c654f
@ -167,8 +167,7 @@ is raised.
|
||||
|
||||
<p class=parameters>
|
||||
<tt>Finalizer</tt> is a function that will be called before
|
||||
<tt>try</tt> throws the exception. It will be called
|
||||
in <em>protected</em> mode.
|
||||
<tt>try</tt> throws the exception.
|
||||
</p>
|
||||
|
||||
<p class=return>
|
||||
|
@ -49,7 +49,7 @@ static void wrap(lua_State *L) {
|
||||
static int finalize(lua_State *L) {
|
||||
if (!lua_toboolean(L, 1)) {
|
||||
lua_pushvalue(L, lua_upvalueindex(1));
|
||||
lua_pcall(L, 0, 0, 0);
|
||||
lua_call(L, 0, 0);
|
||||
lua_settop(L, 2);
|
||||
wrap(L);
|
||||
lua_error(L);
|
||||
|
@ -5,7 +5,6 @@ local finalizer_called
|
||||
local func = socket.protect(function(err, ...)
|
||||
local try = socket.newtry(function()
|
||||
finalizer_called = true
|
||||
error("ignored")
|
||||
end)
|
||||
|
||||
if err then
|
||||
|
Loading…
x
Reference in New Issue
Block a user