修复oops.gui.remove删除后台缓存界面时,未释放掉界面的节点对象问题

This commit is contained in:
dgflash
2023-08-16 15:04:50 +08:00
parent 7c09f312f5
commit 03f89ab6cc

View File

@@ -170,11 +170,10 @@ export class LayerUI extends Node {
private removeCache(prefabPath: string) {
let viewParams = this.ui_cache.get(prefabPath);
if (viewParams) {
var childNode = viewParams.node;
var comp = childNode.getComponent(DelegateComponent)!
comp.remove(true);
this.ui_nodes.delete(viewParams.uuid);
this.ui_cache.delete(prefabPath);
var childNode = viewParams.node;
childNode.destroy();
}
}