From 9458eb868631b29e00182c37f1c7e46981b68edd Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 18 May 2018 15:27:59 +0800 Subject: GC --- src/script/graphics/luaopen_JSL.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/script/graphics/luaopen_JSL.cpp') diff --git a/src/script/graphics/luaopen_JSL.cpp b/src/script/graphics/luaopen_JSL.cpp index 33afa2c..919949c 100644 --- a/src/script/graphics/luaopen_JSL.cpp +++ b/src/script/graphics/luaopen_JSL.cpp @@ -121,11 +121,9 @@ namespace lua static int l_gc(lua_State* L) { - JSLProgram* jsl = checkJSLProgram(L); - if (jsl != nullptr && jsl != NULL) - { - delete jsl; - } + Proxy* proxy = (Proxy*)luax_checktype(L, 1, TYPE_JSL); + JSLProgram* jsl = (JSLProgram*)proxy->object; + delete jsl; return 0; } -- cgit v1.1-26-g67d0