Fastest,Smallest[-Os] 闪退
unity2017.2.1用的是simpleframework_UGUI0.4.1导出xcode 运行
1.在release Fastest,Smallest[-Os] LuaDLL.lua_pcall(L,0,-1,-2)闪退
2.在debug None[-o0] 不闪退
int oldTop1 = LuaDLL.lua_gettop(L);
// Load with Unity3D resources
//string text = LuaHelper.Load(fileName);
byte[] bt = null;
string path = Util.LuaPath(fileName);
Debugger.LogError("----********************--1------Lua->path=" + path);
using (FileStream fs = new FileStream(path, FileMode.Open))
{
BinaryReader br = new BinaryReader(fs);
bt = br.ReadBytes((int)fs.Length);
fs.Close();
}
Debugger.LogError("----********************--2------Lua->bt=" + bt + " bt.Length=" + bt.Length);
//if( text == null )
//{
// ThrowExceptionFromError(oldTop1);
//}
if (LuaDLL.luaL_loadbuffer(L, bt, bt.Length, fileName) != 0)
{
ThrowExceptionFromError(oldTop1);
}
LuaFunction result = translator.getFunction(L, -1);
object[] results1 = translator.popValues(L, oldTop1);
Debugger.LogError("----********************--3------Lua->results1=" + results1[0] + " results1.Length=" + results1.Length);
Debugger.LogError("----********************--4------Lua->results1=" + results1 + " results1.Length=" + results1.Length);
return results1;