Destroy underlying element when resetting or destroying Workspace

This commit is contained in:
Antonio Scandurra
2018-01-12 16:06:35 +01:00
parent 7f408e7791
commit a7e642e473
2 changed files with 9 additions and 1 deletions

View File

@@ -132,6 +132,10 @@ class WorkspaceElement extends HTMLElement {
return this
}
destroy () {
this.subscriptions.dispose()
}
getModel () { return this.model }
handleDragStart (event) {

View File

@@ -310,7 +310,10 @@ module.exports = class Workspace extends Model {
this.originalFontSize = null
this.openers = []
this.destroyedItemURIs = []
this.element = null
if (this.element) {
this.element.destroy()
this.element = null
}
this.consumeServices(this.packageManager)
}
@@ -1570,6 +1573,7 @@ module.exports = class Workspace extends Model {
if (this.activeItemSubscriptions != null) {
this.activeItemSubscriptions.dispose()
}
if (this.element) this.element.destroy()
}
/*