aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-05 17:17:40 +0800
committerchai <chaifix@163.com>2018-12-05 17:17:40 +0800
commitb377954324efc9c75c5bd0e200f9e673ccebe650 (patch)
tree5911a5d8001e0e8fab32dab37960e93237e05d14 /src
parentf9e45fae6b4c1b846f7534e6692a0495d3b2f60d (diff)
*lua bind
Diffstat (limited to 'src')
-rw-r--r--src/lua/common/je_lua.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/common/je_lua.cpp b/src/lua/common/je_lua.cpp
index 8605e62..9a9b0ff 100644
--- a/src/lua/common/je_lua.cpp
+++ b/src/lua/common/je_lua.cpp
@@ -37,7 +37,6 @@ namespace JinEngine
{
if (to == src->state)
return nullptr;
-
// Copy dependencies.
DepsMap& srcDeps = *src->dependencies;
for (DepsMap::iterator it = srcDeps.begin(); it != srcDeps.end(); ++it)
@@ -46,13 +45,14 @@ namespace JinEngine
// Try get lua object.
luax_getobject(src->state, shr);
LuaObject* luaObj = (LuaObject*)luax_checktype(src->state, -1, shr->getType());
+ luax_pop(src->state, 1); // Pop lua object.
luax_copyinstance(to, luaObj);
luax_pop(to, 1); // Pop reference object.
}
SharedBase * shr = src->getSharedBase();
LuaObject* obj = luax_newinstance(to, src->getObjectType(), shr);
(*obj->dependencies) = (*src->dependencies);
- // Add to objects_table
+ // Add to objects_table.
luax_getobjectstable(to);
luax_pushlightuserdata(to, shr);
luax_pushvalue(to, -3);