ParticleSystem destroy后内存泄漏

编辑器版本:cocos creator 3.5.0 3.4.2
将带有ParticleSystem的node instantiate , 再destroy会产生内存泄漏

操作步骤:
1、新建一个空场景
2、建立空节点,把以下脚本挂到节点上。

import { _decorator, Component, Node, instantiate } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('NewComponent')
export class NewComponent extends Component {
    template: Node;
    start () {
        this.template = this.node.children[0];
        this.schedule( ()=>{this.createNone();}, 0.1 );
    }
    createNone( ): void {
        let node = instantiate(this.template);
        node.parent = this.node;
        this.scheduleOnce( ()=>{node.destroy()}, 3.0 );
    }
}

3、在节点下新增Particle
4、执行后F12就会看到内存一直上升

0.1秒创建一个3秒销毁一个不就是一直在增加吗?

0.1秒建一個 , 每個活3秒

场景里最多存在90个粒子吧

1赞

@xunyu1167 合并上面这个 pr 试试

修复pr 试了吗

你好3.3.2能合并此pr吗

相关引擎工程师下班了,明天确认下答复你

测试了,完美解决在 web 上的问题。至于3.3.2 是否可以合并我们没有测试,你可以自行测试一下

原生呢 原生呢

等我确认下回复

原生上泄漏的问题也解决了。

3.4.2能合并吗?

D/jswrapper: JS: [ERROR]: Error: Unresolved id: cocos/core/memop/scalable-container from parentUrl: no-schema:/src/cocos-js/cc.e2a34.js

你好3.3.2合并了pr相关的改动后,web能正常运行,原生直接黑屏报错,能帮看看什么原因吗?

周一过来我们看下

你好 这个问题看了吗

那个粒子的修复 pr,是在这个pr 的基础上做的修复:
https://github.com/cocos/cocos-engine/pull/9640

3.4.2有这个问题吗?需要两个都合并吗?

这个pr 我之前合了的