@ -763,7 +763,8 @@ export default Backbone.Model.extend({
BlockManager,
CodeManager,
Commands,
DeviceManager
DeviceManager,
I18n
} = this.attributes;
this.stopDefault();
DomComponents.destroy();
@ -779,6 +780,7 @@ export default Backbone.Model.extend({
CodeManager.destroy();
Commands.destroy();
DeviceManager.destroy();
I18n.destroy();
this.view.remove();
this.stopListening();
this.clear({ silent: true });
@ -242,6 +242,11 @@ export default () => {
_debug(str, opts = {}) {
const { em, config } = this;
(opts.debug || config.debug) && em && em.logWarning(str);
},
destroy() {
this.config = config;
this.em = {};
}
};