refactor(map): 为所有组件的onDestroy添加父类调用
统一修复组件销毁时未调用父类生命周期方法的问题,确保资源正确释放
This commit is contained in:
@@ -79,6 +79,7 @@ export class IBoxComp extends CCComp {
|
||||
|
||||
/** 解绑点击事件 */
|
||||
onDestroy() {
|
||||
super.onDestroy();
|
||||
if (this.node && this.node.isValid) {
|
||||
this.node.off(NodeEventType.TOUCH_END, this.onTapClose, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user