aboutsummaryrefslogtreecommitdiff
path: root/src/script/graphics/luaopen_Image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/graphics/luaopen_Image.cpp')
-rw-r--r--src/script/graphics/luaopen_Image.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/graphics/luaopen_Image.cpp b/src/script/graphics/luaopen_Image.cpp
index 9506ce4..246ea09 100644
--- a/src/script/graphics/luaopen_Image.cpp
+++ b/src/script/graphics/luaopen_Image.cpp
@@ -63,9 +63,9 @@ namespace lua
static int l_gc(lua_State* L)
{
- Image* i = checkImage(L);
- if (i != nullptr)
- delete i;
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, TYPE_IMAGE);
+ Image* img = (Image*)proxy->object;
+ delete img;
return 0;
}