Fix disposing of a workspace (#3960)

This commit is contained in:
alschmiedt
2020-06-11 14:14:18 -07:00
committed by GitHub
parent 60ea4cc106
commit 84e9802cdb
2 changed files with 8 additions and 10 deletions

View File

@@ -651,9 +651,6 @@ Blockly.Gesture.prototype.handleWsStart = function(e, ws) {
this.setStartWorkspace_(ws);
this.mostRecentEvent_ = e;
this.doStart(e);
if (!this.startBlock_ && !this.startBubble_) {
this.fireWorkspaceClick_(ws);
}
if (this.startWorkspace_.keyboardAccessibilityMode) {
Blockly.navigation.setState(Blockly.navigation.STATE_WS);
}

View File

@@ -817,6 +817,14 @@ Blockly.WorkspaceSvg.prototype.dispose = function() {
this.renderer_.dispose();
if (this.markerManager_) {
this.markerManager_.dispose();
this.markerManager_ = null;
}
Blockly.WorkspaceSvg.superClass_.dispose.call(this);
// Dispose of theme manager after all blocks and mutators are disposed of.
if (this.themeManager_) {
this.themeManager_.unsubscribeWorkspace(this);
this.themeManager_.unsubscribe(this.svgBackground_);
@@ -826,13 +834,6 @@ Blockly.WorkspaceSvg.prototype.dispose = function() {
}
}
if (this.markerManager_) {
this.markerManager_.dispose();
this.markerManager_ = null;
}
Blockly.WorkspaceSvg.superClass_.dispose.call(this);
this.connectionDBList = null;
this.toolboxCategoryCallbacks_ = null;