diff options
author | chai <chaifix@163.com> | 2018-12-04 15:38:19 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-04 15:38:19 +0800 |
commit | adbc170d850a23b219f1718c2cf3e40fadd66ce0 (patch) | |
tree | f26f3d68e3938b2bf147efbe467ed8767e6db5eb /src/lua/modules/thread/je_lua_thread.cpp | |
parent | 85d456d30810347257a33d9443d4ad158d6d5fb1 (diff) |
*拷贝lua object到另一个lua state
Diffstat (limited to 'src/lua/modules/thread/je_lua_thread.cpp')
-rw-r--r-- | src/lua/modules/thread/je_lua_thread.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lua/modules/thread/je_lua_thread.cpp b/src/lua/modules/thread/je_lua_thread.cpp index eea7e24..d99161f 100644 --- a/src/lua/modules/thread/je_lua_thread.cpp +++ b/src/lua/modules/thread/je_lua_thread.cpp @@ -80,14 +80,14 @@ namespace JinEngine } else if (luax_isuserdata(L, vp)) { - void* p = luax_touserdata(L, vp); - shared->send(slot, p); - } + LuaObject* luaObj = (LuaObject*)luax_touserdata(L, vp); + shared->send(slot, luaObj); + }/* else if (luax_islightuserdata(L, vp)) { void* p = luax_tolightuserdata(L, vp); shared->send(slot, p); - } + }*/ return 0; } @@ -125,7 +125,8 @@ namespace JinEngine case Thread::Variant::POINTER: LuaObject* p = (LuaObject*)v.pointer; - LuaObject* luaObj = luax_newinstance(L, p->getObjectType(), p->getSharedBase()); + // Create lua object from other lua_State. + LuaObject* luaObj = luax_newinstance(L, p); break; } @@ -157,8 +158,8 @@ namespace JinEngine case Thread::Variant::POINTER: LuaObject* p = (LuaObject*)v.pointer; - const char* objType = p->getObjectType(); - LuaObject* luaObj = luax_newinstance(L, objType, p->getSharedBase()); + // Create lua object from other lua_State. + LuaObject* luaObj = luax_newinstance(L, p->getObjectType(), p->getSharedBase()); break; } |