aboutsummaryrefslogtreecommitdiff
path: root/src/script/graphics/luaopen_JSL.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-05-18 15:27:59 +0800
committerchai <chaifix@163.com>2018-05-18 15:27:59 +0800
commit9458eb868631b29e00182c37f1c7e46981b68edd (patch)
tree2dea921057473e91e8267d997c743896887f7618 /src/script/graphics/luaopen_JSL.cpp
parent1b773ad2c250e09c09c065eb3eec64bfebde09ca (diff)
GC
Diffstat (limited to 'src/script/graphics/luaopen_JSL.cpp')
-rw-r--r--src/script/graphics/luaopen_JSL.cpp8
1 files changed, 3 insertions, 5 deletions
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;
}