@ -424,6 +424,10 @@ export default () => {
if (!command.stop) command.noStop = 1;
const cmd = CommandAbstract.extend(command);
return new cmd(c);
},
destroy() {
[em, c, commands, defaultCommands, active].forEach(i => (i = {}));
}
};
@ -761,7 +761,8 @@ export default Backbone.Model.extend({
LayerManager,
AssetManager,
BlockManager,
CodeManager
CodeManager,
Commands
} = this.attributes;
this.stopDefault();
DomComponents.clear();
@ -775,6 +776,7 @@ export default Backbone.Model.extend({
AssetManager.destroy();
BlockManager.destroy();
CodeManager.destroy();
Commands.destroy();
this.view.remove();
this.stopListening();
this.clear({ silent: true });