From d79d09557b739aae77d9908e010995152d0b83b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=88=98?= <40414978+PatriceJiang@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:16:34 +0800 Subject: [PATCH] Memleak fix (#16354) --- native/cocos/bindings/manual/jsb_conversions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/native/cocos/bindings/manual/jsb_conversions.h b/native/cocos/bindings/manual/jsb_conversions.h index 580dbfb4d44..5b20a6ce951 100644 --- a/native/cocos/bindings/manual/jsb_conversions.h +++ b/native/cocos/bindings/manual/jsb_conversions.h @@ -1235,6 +1235,7 @@ inline bool nativevalue_to_se(const ccstd::vector &from, se::Value &to, se::O if constexpr (!std::is_pointer::value && is_jsb_object_v) { auto *pFrom = ccnew T(from[i]); nativevalue_to_se(pFrom, tmp, ctx); + tmp.toObject()->getPrivateObject()->tryAllowDestroyInGC(); } else { nativevalue_to_se(from[i], tmp, ctx); }