mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
fix: Fix exception when disposing of a workspace with a variable block obscuring a shadow block. (#8619)
This commit is contained in:
@@ -371,7 +371,14 @@ export class Workspace implements IASTNodeLocation {
|
||||
this.topComments[this.topComments.length - 1].dispose();
|
||||
}
|
||||
eventUtils.setGroup(existingGroup);
|
||||
this.variableMap.clear();
|
||||
// If this is a flyout workspace, its variable map is shared with the
|
||||
// parent workspace, so we either don't want to disturb it if we're just
|
||||
// disposing the flyout, or if the flyout is being disposed because the
|
||||
// main workspace is being disposed, then the main workspace will handle
|
||||
// cleaning it up.
|
||||
if (!this.isFlyout) {
|
||||
this.variableMap.clear();
|
||||
}
|
||||
if (this.potentialVariableMap) {
|
||||
this.potentialVariableMap.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user