From adbc170d850a23b219f1718c2cf3e40fadd66ce0 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 4 Dec 2018 15:38:19 +0800 Subject: =?UTF-8?q?*=E6=8B=B7=E8=B4=9Dlua=20object=E5=88=B0=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AAlua=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/thread/je_lua_thread.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/lua/modules/thread/je_lua_thread.cpp') 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; } -- cgit v1.1-26-g67d0