Skip to content

Commit

Permalink
fix: Fix exception when disposing of a workspace with a variable bloc…
Browse files Browse the repository at this point in the history
…k obscuring a shadow block.
  • Loading branch information
gonfunko committed Oct 11, 2024
1 parent 2dfd8c3 commit 605eaa1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 605eaa1

Please sign in to comment.