From 84e9802cdb8af08be729fe8709f3ed0dbf1fb3a9 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Thu, 11 Jun 2020 14:14:18 -0700 Subject: [PATCH] Fix disposing of a workspace (#3960) --- core/gesture.js | 3 --- core/workspace_svg.js | 15 ++++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/gesture.js b/core/gesture.js index cba4fef03..c100f95f5 100644 --- a/core/gesture.js +++ b/core/gesture.js @@ -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); } diff --git a/core/workspace_svg.js b/core/workspace_svg.js index e2c9176a2..e759c3716 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -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;