diff --git a/cocos/game/director.ts b/cocos/game/director.ts index 038a4a0f916..aa3b79d7467 100644 --- a/cocos/game/director.ts +++ b/cocos/game/director.ts @@ -806,6 +806,7 @@ export class Director extends EventTarget { } /** + * @engineInternal * @en Build custom render pipeline * @zh 构建自定义渲染管线 */ diff --git a/native/cocos/renderer/pipeline/custom/NativePipeline.cpp b/native/cocos/renderer/pipeline/custom/NativePipeline.cpp index c8568f23405..f0814b7715e 100644 --- a/native/cocos/renderer/pipeline/custom/NativePipeline.cpp +++ b/native/cocos/renderer/pipeline/custom/NativePipeline.cpp @@ -1319,6 +1319,9 @@ void buildRenderPipeline() { if(global->getProperty("jsb", &jsbVal) && jsbVal.isObject()) { jsbVal.toObject()->getProperty("buildRenderPipeline", &buildRPVal); } + se::ScriptEngine::getInstance()->addBeforeCleanupHook([]() { + buildRPVal.setUndefined(); + }); } se::ValueArray args; buildRPVal.toObject()->call(args, nullptr);