From 38657c7c7a71bf55187db5b4acdb7159b5866a66 Mon Sep 17 00:00:00 2001 From: johnche Date: Wed, 28 Feb 2024 15:16:19 +0800 Subject: [PATCH] =?UTF-8?q?[unreal]=E8=A7=A3=E5=86=B3=E9=9D=99=E6=80=81?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=90=ABconst=20UObject*=E7=9A=84=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E6=8A=A5=E9=94=99=EF=BC=8Cfix=20https://gith?= =?UTF-8?q?ub.com/Tencent/puerts/issues/1665?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp b/unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp index 5ecd211a50..6c580aa5e9 100644 --- a/unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp +++ b/unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp @@ -303,7 +303,8 @@ struct Converter toScript(v8::Local context, T* value) { - return DataTransfer::FindOrAddObject(context->GetIsolate(), context, value); + using TypeWithoutConst = typename std::remove_const::type; + return DataTransfer::FindOrAddObject(context->GetIsolate(), context, (TypeWithoutConst*) (value)); } static T* toCpp(v8::Local context, const v8::Local& value)