Only remove procedure decls when the block is in the main workspace
@@ -382,7 +382,8 @@ Blockly.Blocks['procedures_defnoreturn'] = {
Blockly.BlockSvg.prototype.dispose.apply(this, arguments);
var procDb = workspace.getProcedureDatabase();
- if (editable && procDb) { // only true for the top-level workspaces, not flyouts/flydowns
+ if (editable && procDb && workspace == Blockly.mainWorkspace) {
+ // only remove for the top-level workspaces, not flyouts/flydowns
procDb.removeProcedure(this.id);
}
