cocos-engine
cocos-engine copied to clipboard
fix spine cache animation delete material cache bug
原生平台spine使用缓存时,在组件update时候进行操作可能会导致删除正在使用的材质信息,导致绘制访问异常内存而崩溃。
例如:
import { _decorator, Component, director, math, Node, sp } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('Tester')
export class Tester extends Component {
@property(sp.Skeleton)
private skeleton: sp.Skeleton;
update(deltaTime: number) {
if (director.getTotalFrames() == 3) {
this.skeleton.enabled = false;
this.skeleton.setSkin("e yu");
this.skeleton.enabled = true;
}
}
}
除update阶段,还存在其他一些阶段有问题,不列举了。
Interface Check Report
This pull request does not change any public interfaces !
@xinyangtan Could you upload a reproducible demo? I can't reproduce it locally with the information you provided.
@xinyangtan Could you upload a reproducible demo? I can't reproduce it locally with the information you provided.
SpineShareCacheBug.zip @bofeng-song Use this project to build windows. it will crash when running.
@xinyangtan Could you upload a reproducible demo? I can't reproduce it locally with the information you provided.
SpineShareCacheBug.zip @bofeng-song Use this project to build windows. it will crash when running.
I have supplemented your modifications, mainly addressing common issues in realTime and DragonBone. Please merge my changes, and set the target version for the merge to 3.8.4, as we have frozen 3.8.3. https://github.com/xinyangtan/cocos-engine/pull/1