From 467e3a056b176e7a53bd4e436ace61740bac2677 Mon Sep 17 00:00:00 2001 From: johnche Date: Fri, 7 Feb 2025 11:15:22 +0800 Subject: [PATCH] =?UTF-8?q?[unreal]=E4=B8=8A=E4=B8=AA=E6=94=B9=E6=B3=95?= =?UTF-8?q?=E7=94=A8=E5=88=B0=E7=9A=84v8=E6=8E=A5=E5=8F=A3=E5=9C=A8quickjs?= =?UTF-8?q?=20backend=E6=B2=A1=E6=9C=89=E6=A8=A1=E6=8B=9F=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=8F=A6=E5=A4=96=E4=B8=80=E7=A7=8D=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unreal/Puerts/Source/JsEnv/Public/JsObject.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/unreal/Puerts/Source/JsEnv/Public/JsObject.h b/unreal/Puerts/Source/JsEnv/Public/JsObject.h index b487f3304d..8d1b890ad6 100644 --- a/unreal/Puerts/Source/JsEnv/Public/JsObject.h +++ b/unreal/Puerts/Source/JsEnv/Public/JsObject.h @@ -49,8 +49,10 @@ struct FJsObject #ifdef THREAD_SAFE v8::Locker Locker(Isolate); #endif - GContext.Reset(Isolate, InOther.GContext); - GObject.Reset(Isolate, InOther.GObject); + v8::Isolate::Scope IsolateScope(Isolate); + v8::HandleScope HandleScope(Isolate); + GContext.Reset(Isolate, InOther.GContext.Get(Isolate)); + GObject.Reset(Isolate, InOther.GObject.Get(Isolate)); JsEnvLifeCycleTracker = PUERTS_NAMESPACE::DataTransfer::GetJsEnvLifeCycleTracker(Isolate); } @@ -96,8 +98,10 @@ struct FJsObject return *this; } Isolate = InOther.Isolate; - GContext.Reset(Isolate, InOther.GContext); - GObject.Reset(Isolate, InOther.GObject); + v8::Isolate::Scope IsolateScope(Isolate); + v8::HandleScope HandleScope(Isolate); + GContext.Reset(Isolate, InOther.GContext.Get(Isolate)); + GObject.Reset(Isolate, InOther.GObject.Get(Isolate)); JsEnvLifeCycleTracker = PUERTS_NAMESPACE::DataTransfer::GetJsEnvLifeCycleTracker(Isolate); return *this; }