Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

IL2CPP crash.

Discussion in 'Android' started by wiyi, Nov 17, 2015.

  1. wiyi

    wiyi

    Joined:
    Feb 20, 2013
    Posts:
    17
    Editor:Unity 5.2.2f1
    PC:win7 X64
    NDK:android-ndk-r10b_x86

    struct TEST4
    {
    public int subMeshIndex { get; set; }
    public Matrix4x4 transform { get; set; }
    }
    void Test4()
    {
    List<TEST4> tests = new List<TEST4>();
    tests.Add(new TEST4());//Crashed
    }

    the app crashed,when Call Test4();
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,740
    @wiyi

    This should work correctly. Does this work with the Mono scripting backend? If so, can you submit a bug report and let me know the bug report number? Thanks.
     
  3. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,165
    We have a bug reported for the issue. It happens when you pass large value-types (struct) to a generic function (List<T>.Add()). I'll post the link to public issuetracker when it's available.

    In the meanwhile, you can easily workaround the issue by declaring class TEST4 instead of struct TEST4.
     
    wiyi likes this.
  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,165