mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 19:07:30 +08:00
修复CCEntity释放时报错问题
This commit is contained in:
@@ -170,9 +170,16 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
//#endregion
|
||||
|
||||
destroy(): void {
|
||||
this.singletons.clear();
|
||||
this.businesss.forEach(business => business.destroy());
|
||||
this.businesss.clear();
|
||||
if (this.singletons) {
|
||||
this.singletons.clear();
|
||||
this.singletons = null!;
|
||||
}
|
||||
|
||||
if (this.businesss) {
|
||||
this.businesss.forEach(business => business.destroy());
|
||||
this.businesss.clear();
|
||||
this.businesss = null!;
|
||||
}
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user