main

-- 避免内存泄漏
collectgarbage("setpause", 100)
collectgarbage("setstepmul", 5000)

-- 打印全局错误处理
function __G__TRACKBACK__(errorMessage)
    CCLuaLog("----------------------------------------")
    CCLuaLog("LUA ERROR: "..tostring(errorMessage).."
")
    CCLuaLog(debug.traceback("", 2))
    CCLuaLog("----------------------------------------")
end

--CCLuaLoadChunksFromZip("res/framework_precompiled.zip")
    
-- 保护模式运行
xpcall(function()
    require("res.scripts.game")
    game.startup()
end, __G__TRACKBACK__)
原文地址:https://www.cnblogs.com/newlist/p/3652017.html