Hi Zoey,
What a pity that you had to spend your valuable time on analyzing my custom code, to find out it was not a Blockly issue. But your assistance is highly appreciated!
Just to make sure I understand it correctly.
About the quote "serializing the workspace as XML before destructing the old Blockly instance".
Currently it works like this:
var dom = Blockly.Xml.workspaceToDom(node.workspace);
var originalXml = Blockly.Xml.domToPrettyText(dom);
createWorkspace(node, originalXml);
function createWorkspace(node, workspaceXml) {
...
if (node.workspace) {
node.workspace.dispose();
node.workspace = null;
}
...
node.workspace = Blockly.inject('blocklyDiv', { ... });
...
}
So I serialize the old workspace (to originalXml) before I destruct the old workspace.
Is there anything else that I should destruct, to (hopefully) make sure the old instance isn't compared to a new class?
Thanks!
Bart