diff options
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; } |