refactor(map): 为所有组件的onDestroy添加父类调用
统一修复组件销毁时未调用父类生命周期方法的问题,确保资源正确释放
This commit is contained in:
@@ -254,6 +254,7 @@ export class TalentsComp extends CCComp {
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
super.onDestroy();
|
||||
mLogger.log(this.debugMode, 'TalentsComp', "释放界面");
|
||||
if (this.btn_reset && this.btn_reset.node && this.btn_reset.node.isValid) {
|
||||
this.btn_reset.node.off(Button.EventType.CLICK, this.onResetClicked, this);
|
||||
|
||||
Reference in New Issue
Block a user