diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 4ec9b0e44..0a68fe98d 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -594,12 +594,9 @@ Blockly.WorkspaceSvg.prototype.dispose = function() { this.grid_ = null; } - if (this.toolboxCategoryCallbacks_) { - this.toolboxCategoryCallbacks_ = null; - } - if (this.flyoutButtonCallbacks_) { - this.flyoutButtonCallbacks_ = null; - } + this.toolboxCategoryCallbacks_ = null; + this.flyoutButtonCallbacks_ = null; + if (!this.options.parentWorkspace) { // Top-most workspace. Dispose of the div that the // SVG is injected into (i.e. injectionDiv).