diff --git a/modules/console/console.lua b/modules/console/console.lua index 5246cc41..5555f19c 100644 --- a/modules/console/console.lua +++ b/modules/console/console.lua @@ -44,6 +44,7 @@ function Console.create() end function Console.destroy() + Logger.setOnLog(nil) console:destroy() console = nil end diff --git a/src/framework/luascript/luainterface.cpp b/src/framework/luascript/luainterface.cpp index 58b5370b..fd8b03d6 100644 --- a/src/framework/luascript/luainterface.cpp +++ b/src/framework/luascript/luainterface.cpp @@ -661,12 +661,6 @@ bool LuaInterface::next(int index) return lua_next(L, index); } -void LuaInterface::copy(int index) -{ - assert(hasIndex(index)); - lua_pushvalue(L, index); -} - void LuaInterface::getStackFunction(int level) { lua_Debug ar; @@ -679,6 +673,7 @@ void LuaInterface::getStackFunction(int level) void LuaInterface::getRef(int ref) { lua_rawgeti(L, LUA_REGISTRYINDEX, ref); + //logTraceDebug(ref); } void LuaInterface::getWeakRef(int weakRef) @@ -718,12 +713,14 @@ void LuaInterface::getMetatable(int index) void LuaInterface::getField(const char* key, int index) { assert(hasIndex(index)); + assert(isUserdata(index) || isTable(index)); lua_getfield(L, index, key); } void LuaInterface::setField(const char* key, int index) { assert(hasIndex(index)); + assert(isUserdata(index) || isTable(index)); lua_setfield(L, index, key); } diff --git a/src/framework/luascript/luainterface.h b/src/framework/luascript/luainterface.h index 6bde3950..a16edc33 100644 --- a/src/framework/luascript/luainterface.h +++ b/src/framework/luascript/luainterface.h @@ -175,7 +175,6 @@ public: void insert(int index); void remove(int index); bool next(int index = -2); - void copy(int index = -1); void getStackFunction(int level = 0); diff --git a/src/framework/luascript/luaobject.cpp b/src/framework/luascript/luaobject.cpp index 416c0b04..9cf725e1 100644 --- a/src/framework/luascript/luaobject.cpp +++ b/src/framework/luascript/luaobject.cpp @@ -12,8 +12,10 @@ LuaObject::~LuaObject() void LuaObject::releaseLuaFieldsTable() { - if(m_fieldsTableRef != -1) + if(m_fieldsTableRef != -1) { g_lua.unref(m_fieldsTableRef); + m_fieldsTableRef = -1; + } } void LuaObject::luaSetField(const std::string& key) diff --git a/src/framework/ui/uiwidget.cpp b/src/framework/ui/uiwidget.cpp index eef070ee..c9c4cd15 100644 --- a/src/framework/ui/uiwidget.cpp +++ b/src/framework/ui/uiwidget.cpp @@ -31,7 +31,6 @@ UIWidget::UIWidget(UIWidgetType type) UIWidget::~UIWidget() { - //logTraceDebug(m_id); if(!m_destroyed) logWarning("widget '", m_id, "' was destructed without being explicit destroyed"); }