mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
fix: dispose performance (#6894)
* fix: improve dispose performance * chore: cleanup dispose functions * chore: split dispose into dispose and disposeInternal * chore: remove unnecessary node removal * fix: remove unnecessary unbinding of event listeners * fix: readd skipping event construction * chore: work on fixing tests * chore: fix remaining test failures * chore: format * chore: typo * fix: first pass of PR comments * chore: remove TODO
This commit is contained in:
@@ -489,14 +489,11 @@ export abstract class Field<T = any> implements IASTNodeLocationSvg,
|
||||
dispose() {
|
||||
dropDownDiv.hideIfOwner(this);
|
||||
WidgetDiv.hideIfOwner(this);
|
||||
Tooltip.unbindMouseEvents(this.getClickTarget_());
|
||||
|
||||
if (this.mouseDownWrapper_) {
|
||||
browserEvents.unbind(this.mouseDownWrapper_);
|
||||
if (!this.getSourceBlock()?.isDeadOrDying()) {
|
||||
dom.removeNode(this.fieldGroup_);
|
||||
}
|
||||
|
||||
dom.removeNode(this.fieldGroup_);
|
||||
|
||||
this.disposed = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user