void LuaInterface::pushObject(const LuaObjectPtr& obj) { // fills a new userdata with a new LuaObjectPtr pointer new(newUserdata(sizeof(LuaObjectPtr))) LuaObjectPtr(obj); // set the userdata metatable getGlobal(Fw::mkstr(obj->getClassName(), "_mt")); assert(!isNil()); setMetatable(); }
void LuaInterface::pushObject(const LuaObjectPtr& obj) { // fills a new userdata with a new LuaObjectPtr pointer new(newUserdata(sizeof(LuaObjectPtr))) LuaObjectPtr(obj); m_totalObjRefs++; obj->luaGetMetatable(); if(isNil()) g_logger.fatal(stdext::format("metatable for class '%s' not found, did you bind the C++ class?", obj->getClassName())); setMetatable(); }