Don't swallow errors in finalizers.

master
Philipp Janda 2016-02-24 00:48:43 +01:00
parent 9ffd96724d
commit 9fe38c654f
3 changed files with 2 additions and 4 deletions

View File

@ -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>

View File

@ -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);

View File

@ -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