diff --git a/unreal/Puerts/Source/JsEnv/Private/JsEnvImpl.cpp b/unreal/Puerts/Source/JsEnv/Private/JsEnvImpl.cpp index 70fa27fa98..0a2c99bbbd 100644 --- a/unreal/Puerts/Source/JsEnv/Private/JsEnvImpl.cpp +++ b/unreal/Puerts/Source/JsEnv/Private/JsEnvImpl.cpp @@ -4320,14 +4320,11 @@ void FJsEnvImpl::Mixin(const v8::FunctionCallbackInfo& Info) bool IsReuseTemplate = false; auto StructWrapper = GetStructWrapper(New, IsReuseTemplate); StructWrapper->IsNativeTakeJsRef = TakeJsObjectRef; - if (TakeJsObjectRef) + for (auto& KV : TypeToTemplateInfoMap) { - for (auto& KV : TypeToTemplateInfoMap) + if (New != KV.Key && KV.Key->IsChildOf(New)) { - if (New != KV.Key && KV.Key->IsChildOf(New)) - { - KV.Value.StructWrapper->IsNativeTakeJsRef = true; - } + KV.Value.StructWrapper->IsNativeTakeJsRef = TakeJsObjectRef; } } Info.GetReturnValue().Set(FindOrAdd(Isolate, Context, New->GetClass(), New));