public abstract class A<T>
{
public List<T> D = new List<T>();
}
public class B<T1, T2> : A<Action<T1, T2>>
{
}
public class C
{
}
public class HotUpdateMain : MonoBehaviour
{
public B<C, C> B = new B<C, C>();
void Start()
{
UnityEngine.Debug.Log(B.D.Count);
}
}
崩溃信息:
Exception thrown: read access violation.method->klass->rgctx_data was nullptr.
崩溃调用栈:
GameAssembly.dll!A_1__ctor_mEED8058ABFA500A40294771CB8E97D19EE7AB818_gshared(A_1_t07D96EE2B9CE8B3CD0D4BD89B30F9AC917BB780B * __this, const MethodInfo * method) Line 10606 C++
GameAssembly.dll!B_2__ctor_m60BC8C51983FF411DB5E772CEBC95CD7AB257757_gshared(B_2_t2654A0DA705819C42DC5558AE9A2DD5159BB992D * __this, const MethodInfo * method) Line 36301 C++
GameAssembly.dll!B_2__ctor_mF25B031406C1FDBCB812BCD1EDC944C8771F76BB(B_2_t0B5CD9A23C3DA938F788BE1B5E0E6CACD5A75F16 * __this, const MethodInfo * method) Line 854 C++
GameAssembly.dll!HotUpdateMain__ctor_m5549897CFBEE17CCA2EBEFF1DE62E41891423004(HotUpdateMain_t9691E9193AC822C20C46ED6B1C1F26EEB0EC8F21 * __this, const MethodInfo * method) Line 1223 C++
GameAssembly.dll!RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5(void(*)() methodPointer, const MethodInfo * methodMetadata, void * obj, void * * args) Line 28206 C++
GameAssembly.dll!il2cpp::vm::Runtime::Invoke(const MethodInfo * method, void * obj, void * * params, Il2CppException * * exc) Line 559 C++
GameAssembly.dll!il2cpp::vm::Runtime::ObjectInitException(Il2CppObject * object, Il2CppException * * exc) Line 600 C++
GameAssembly.dll!il2cpp_runtime_object_init_exception(Il2CppObject * obj, Il2CppException * * exc) Line 1133 C++
UnityPlayer.dll!scripting_unity_engine_object_new_and_invoke_default_constructor(class ScriptingClassPtr,class Object *,class ScriptingExceptionPtr *) Unknown
UnityPlayer.dll!SerializableManagedRef::RebuildMonoInstance(class Object *,class ScriptingClassPtr,class ScriptingObjectPtr,class MonoScript *) Unknown
环境
问题
下面代码可复现:
崩溃信息:
崩溃调用栈: