don't crash when closing a background tab after recovery

This commit is contained in:
Eugene Pankov 2017-07-05 14:54:57 +02:00
parent e6ef21fa9d
commit 80762e92d6

View File

@ -307,8 +307,10 @@ export class TerminalTabComponent extends BaseTabComponent {
decorator.detach(this)
})
this.configSubscription.unsubscribe()
this.sessionCloseSubscription.unsubscribe()
this.hotkeysSubscription.unsubscribe()
if (this.sessionCloseSubscription) {
this.sessionCloseSubscription.unsubscribe()
}
this.resize$.complete()
this.input$.complete()
this.output$.complete()
@ -320,7 +322,9 @@ export class TerminalTabComponent extends BaseTabComponent {
async destroy () {
super.destroy()
await this.session.destroy()
if (this.session) {
await this.session.destroy()
}
}
private setFontSize () {