From 793b0aec70196ead1f2af01ff0e2fe330f5109d1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 2 Dec 2024 11:45:45 +0800 Subject: [PATCH] Fix that assets in scene configured with `autorelease` could not be auto released after switching scene. It's a memory leak from v3.8.1. --- cocos/scene-graph/node.jsb.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cocos/scene-graph/node.jsb.ts b/cocos/scene-graph/node.jsb.ts index 8fd82f1dd5e..4b99c37f42b 100644 --- a/cocos/scene-graph/node.jsb.ts +++ b/cocos/scene-graph/node.jsb.ts @@ -1171,6 +1171,14 @@ Object.defineProperty(nodeProto, 'scene', { } }); +Object.defineProperty(nodeProto, 'id', { + configurable: true, + enumerable: true, + set(id) { + this._id = id; + } +}); + nodeProto.rotate = function (rot: Quat, ns?: NodeSpace): void { _tempFloatArray[1] = rot.x; _tempFloatArray[2] = rot.y;