Catch errors in love.font.newRasterizer, add luax_pconvobj which pcalls, allowing love.graphics.newFont to clean up before re-erroring

This commit is contained in:
Bart van Strien
2012-12-15 14:26:46 +01:00
parent 82ea98aa65
commit 68a895e7c6
4 changed files with 50 additions and 10 deletions
@@ -277,7 +277,12 @@ int w_newFont(lua_State *L)
if (luax_istype(L, 1, DATA_T))
{
int idxs[] = {1, 2};
luax_convobj(L, idxs, 2, "font", "newRasterizer");
int ret = luax_pconvobj(L, idxs, 2, "font", "newRasterizer");
if (ret != 0)
{
font_data->release();
return lua_error(L);
}
}
if (font_data)