[fix] 修复__ReversePInvokeMethod_XXX函数未设置Il2CppThreadContext,导致从native线程回调时获取Thread变量崩溃的bug
parent
d9776d1793
commit
a36e3fe72d
|
@ -31,6 +31,7 @@ namespace HybridCLR.Editor.ReversePInvokeWrap
|
||||||
codes.Add($@"
|
codes.Add($@"
|
||||||
{method.ReturnInfo.Type.GetTypeName()} __ReversePInvokeMethod_{methodIndex}({paramDeclaringListWithoutMethodInfoStr})
|
{method.ReturnInfo.Type.GetTypeName()} __ReversePInvokeMethod_{methodIndex}({paramDeclaringListWithoutMethodInfoStr})
|
||||||
{{
|
{{
|
||||||
|
il2cpp::vm::ScopedThreadAttacher _vmThreadHelper;
|
||||||
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex({methodIndex});
|
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex({methodIndex});
|
||||||
{methodTypeDef};
|
{methodTypeDef};
|
||||||
{(method.ReturnInfo.IsVoid ? "" : "return ")}((Callback)(method->methodPointerCallByInterp))({paramNameListWithoutMethodInfoStr});
|
{(method.ReturnInfo.IsVoid ? "" : "return ")}((Callback)(method->methodPointerCallByInterp))({paramNameListWithoutMethodInfoStr});
|
||||||
|
|
Loading…
Reference in New Issue