aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/je_lua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/common/je_lua.cpp')
-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);