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