@ -124,6 +124,14 @@ export default () => {
*/
render() {
return view.render().el;
},
destroy() {
devices.reset();
devices.stopListening();
view.remove();
[devices, view].forEach(i => (i = null));
c = {};
}
};
@ -762,7 +762,8 @@ export default Backbone.Model.extend({
AssetManager,
BlockManager,
CodeManager,
Commands
Commands,
DeviceManager
} = this.attributes;
this.stopDefault();
DomComponents.clear();
@ -777,6 +778,7 @@ export default Backbone.Model.extend({
BlockManager.destroy();
CodeManager.destroy();
Commands.destroy();
DeviceManager.destroy();
this.view.remove();
this.stopListening();
this.clear({ silent: true });