mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 21:20:28 +00:00
refactor(mem): 继续优化内存泄漏问题
This commit is contained in:
parent
b65460f029
commit
3853f76ff9
@ -118,7 +118,6 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
|
||||
purge() {
|
||||
this.disposeItems();
|
||||
this.parent = null as any;
|
||||
}
|
||||
|
||||
// ======= compatibles for vision ======
|
||||
|
||||
@ -204,6 +204,7 @@ export class SettingTopEntry implements SettingEntry {
|
||||
|
||||
purge() {
|
||||
this.disposeItems();
|
||||
this._settingFieldMap = {};
|
||||
this.emitter.removeAllListeners();
|
||||
}
|
||||
|
||||
|
||||
@ -770,6 +770,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
this.purged = true;
|
||||
this.autoruns?.forEach((dispose) => dispose());
|
||||
this.props.purge();
|
||||
this.settingEntry.purge();
|
||||
// this.document.destroyNode(this);
|
||||
}
|
||||
|
||||
|
||||
@ -4,4 +4,12 @@ if (typeof window !== 'undefined') {
|
||||
(window as any).SimulatorRenderer = renderer;
|
||||
}
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
(window as any).LCSimulatorHost = null;
|
||||
// @ts-ignore
|
||||
renderer.dispose?.();
|
||||
(window as any).SimulatorRenderer = null;
|
||||
(window as any).ReactDOM.unmountComponentAtNode(document.getElementById('app'));
|
||||
});
|
||||
|
||||
export default renderer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user