aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/thread/je_lua_thread.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-05 15:47:41 +0800
committerchai <chaifix@163.com>2018-12-05 15:47:41 +0800
commitd14d3de517e3bea5470ba42a4d1646cca77c2d25 (patch)
treefcc9e18b37b0e3cbddd8715fe093dc6e0a5945fe /src/lua/modules/thread/je_lua_thread.cpp
parentf6a902ebd5743d54321e1232dae40f15041be5a6 (diff)
*lua reference
Diffstat (limited to 'src/lua/modules/thread/je_lua_thread.cpp')
-rw-r--r--src/lua/modules/thread/je_lua_thread.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lua/modules/thread/je_lua_thread.cpp b/src/lua/modules/thread/je_lua_thread.cpp
index d99161f..dc6a27a 100644
--- a/src/lua/modules/thread/je_lua_thread.cpp
+++ b/src/lua/modules/thread/je_lua_thread.cpp
@@ -126,7 +126,7 @@ namespace JinEngine
case Thread::Variant::POINTER:
LuaObject* p = (LuaObject*)v.pointer;
// Create lua object from other lua_State.
- LuaObject* luaObj = luax_newinstance(L, p);
+ LuaObject* luaObj = luax_copyinstance(L, p);
break;
}
@@ -159,7 +159,7 @@ namespace JinEngine
case Thread::Variant::POINTER:
LuaObject* p = (LuaObject*)v.pointer;
// Create lua object from other lua_State.
- LuaObject* luaObj = luax_newinstance(L, p->getObjectType(), p->getSharedBase());
+ LuaObject* luaObj = luax_copyinstance(L, p);
break;
}
@@ -205,9 +205,7 @@ namespace JinEngine
{ "isRunning", l_isRunning },
{ 0, 0 }
};
-
luax_newtype(L, Jin_Lua_Thread, thread_function);
-
return 0;
}
@@ -230,14 +228,12 @@ namespace JinEngine
LUA_EXPORT int luaopen_thread(lua_State* L)
{
luaopen_Thread(L);
-
luaL_Reg methods[] = {
{ "newThread", l_newThread },
{ "getThread", l_getThread },
{ 0, 0 }
};
luax_newlib(L, methods);
-
return 1;
}