dimanche 11 mai 2014

c# - la méthode Compile de l'Expression <TDelegate>commet une erreur fatale sur Android - Stack Overflow


Can a Compile() method make a fatal error enough to turn off the application on android platform?

When I call that method below about 50~100 times on android platform, my application gets
turned off. but on UnityEditor it works well.
There's no null value or invalid param or any expression. And the lambda.ToString() log on android
is exactly the same as the thing on Unity Editor.
I have no idea why that method with such a simple expression makes the application turned
off. It's getting me crazy.


protected virtual object VisitMemberAccess(MemberExpression m)
{
var member = Expression.Convert(m, typeof(object));
var lambda = Expression.Lambda<Func<object>>(member);
var getter = lambda.Compile(); //<===== this is the one who gets me crazy.
return getter();
}


Can a Compile() method make a fatal error enough to turn off the application on android platform?

When I call that method below about 50~100 times on android platform, my application gets
turned off. but on UnityEditor it works well.
There's no null value or invalid param or any expression. And the lambda.ToString() log on android
is exactly the same as the thing on Unity Editor.
I have no idea why that method with such a simple expression makes the application turned
off. It's getting me crazy.


protected virtual object VisitMemberAccess(MemberExpression m)
{
var member = Expression.Convert(m, typeof(object));
var lambda = Expression.Lambda<Func<object>>(member);
var getter = lambda.Compile(); //<===== this is the one who gets me crazy.
return getter();
}

0 commentaires:

Enregistrer un commentaire