Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Jan 5, 2024
2 parents 6aa2eb4 + 166c92f commit b7e659e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/celscript/lua/celx_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,22 @@ static int font_tostring(lua_State* l)
return celx.push("[Font]");
}

static int font_gc(lua_State* l)
{
CelxLua celx(l);
auto *font = celx.getThis<std::shared_ptr<TextureFont>>();
font->~shared_ptr();
return 0;
}

void CreateFontMetaTable(lua_State* l)
{
CelxLua celx(l);

celx.createClassMetatable(Celx_Font);

celx.registerMethod("__tostring", font_tostring);
celx.registerMethod("__gc", font_gc);
celx.registerMethod("bind", font_bind);
celx.registerMethod("render", font_render);
celx.registerMethod("unbind", font_unbind);
Expand Down

0 comments on commit b7e659e

Please sign in to comment.