From 7997118ed6454719f805031f365ee2afc291ec68 Mon Sep 17 00:00:00 2001 From: johnche Date: Wed, 11 Dec 2024 10:55:44 +0800 Subject: [PATCH] =?UTF-8?q?[unity]il2cpp=E4=BC=98=E5=8C=96=E7=89=B9?= =?UTF-8?q?=E6=80=A7=E5=AF=B9=E4=B8=80=E4=B8=AAjs=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E9=A2=91=E7=B9=81=E4=BC=A0=E9=80=92=E5=88=B0C#=E5=90=8E?= =?UTF-8?q?=E9=A9=AC=E4=B8=8A=E9=87=8A=E6=94=BE=E6=A6=82=E7=8E=87=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=B4=A9=E6=BA=83=20fix=20https://github.com/Tencent/?= =?UTF-8?q?puerts/issues/1940?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upm/Editor/Resources/puerts/xil2cpp/Puerts_il2cpp.cpp.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unity/Assets/core/upm/Editor/Resources/puerts/xil2cpp/Puerts_il2cpp.cpp.txt b/unity/Assets/core/upm/Editor/Resources/puerts/xil2cpp/Puerts_il2cpp.cpp.txt index 01bf26e898..6cbfd29112 100644 --- a/unity/Assets/core/upm/Editor/Resources/puerts/xil2cpp/Puerts_il2cpp.cpp.txt +++ b/unity/Assets/core/upm/Editor/Resources/puerts/xil2cpp/Puerts_il2cpp.cpp.txt @@ -563,6 +563,10 @@ static Il2CppGCHandle* FindOrCreateHandleStoreOfValue(struct pesapi_ffi* apis, p { *out_object = il2cpp::gc::GCHandle::GetTarget(*res); //PLog("found existed jsobject:%p", *out_object); + if (out_object == nullptr) + { + value_ref = apis->duplicate_value_ref(value_ref); + } } *out_value_ref = value_ref;