Unity crash if [SerializeReference] is used

I made a report about crush (http://fogbugz.unity3d.com/default.asp?1193292), but, just in case, want to ask, if I use the new SerializeReference attribute correctly ?

  1. What happened
    Unity Crash after SerializableObject with [SerializeReference]

  2. How we can reproduce it using the example you attached
    Use this class and choose from menu Create → Test

using System;
using System.Collections.Generic;
using UnityEngine;

namespace viewer.editor.info.ship
{
[CreateAssetMenu(fileName = “Test”, menuName = “Test”, order = 52)]
public class InfosTest : ScriptableObject
{
[SerializeField] private List infos = new List();
}

[Serializable]
public class InfoTest
{
[SerializeReference] private List infos = new List();
}

public interface ITest
{
}
}

Unity Version: 2019.3.0b7, Windows10

Hi gadgetfan,
This is a duplicate of the following issue: Unity Issue Tracker - Crash on TypeTreeQueries::ReadStringFromBuffer or freeze when you add a component with SerializeReference interface
on which we are currently working.
Regards,
Martin

2 Likes

Now I’m not sure, that my crash is a duplicate :slight_smile: . In ussue description states: Not reproducible with: … 2019.3.0a7
I just downloaded Unity 2019.3.0a7 and my code still crashes Unity.

Can confirm this still occurs in 2019.3.0b10. :frowning:

2 Likes

I had to remove all [SerializeRefence] from my code for now :frowning: . Very usefull annotation, but could be used after fix only.

Can confirm this still occurs in 2019.3.0b12. :frowning: please…

The fix will be in the next release, .0f2.

1 Like