diff options
author | chai <chaifix@163.com> | 2018-12-05 15:47:41 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-05 15:47:41 +0800 |
commit | d14d3de517e3bea5470ba42a4d1646cca77c2d25 (patch) | |
tree | fcc9e18b37b0e3cbddd8715fe093dc6e0a5945fe /src/lua/modules/thread/je_lua_thread.cpp | |
parent | f6a902ebd5743d54321e1232dae40f15041be5a6 (diff) |
*lua reference
Diffstat (limited to 'src/lua/modules/thread/je_lua_thread.cpp')
-rw-r--r-- | src/lua/modules/thread/je_lua_thread.cpp | 8 |
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; } |