From 03eee86ddb86286c1c7fdf812edc672b1efb035d Mon Sep 17 00:00:00 2001 From: rxi Date: Wed, 22 Apr 2020 00:41:23 +0100 Subject: [PATCH] Made font.gc() do null-check in case font.load() failed --- src/api/renderer_font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/renderer_font.c b/src/api/renderer_font.c index e43a952..452aede 100644 --- a/src/api/renderer_font.c +++ b/src/api/renderer_font.c @@ -24,7 +24,7 @@ static int f_set_tab_width(lua_State *L) { static int f_gc(lua_State *L) { RenFont **self = luaL_checkudata(L, 1, API_TYPE_FONT); - rencache_free_font(*self); + if (*self) { rencache_free_font(*self); } return 0; }