fix terminal element destroy. do not render if screen is destroyed.
This commit is contained in:
parent
b54e86d361
commit
29c9d1529a
|
@ -717,6 +717,8 @@ Screen.prototype.alloc = function() {
|
|||
Screen.prototype.render = function() {
|
||||
var self = this;
|
||||
|
||||
if (this.destroyed) return;
|
||||
|
||||
this.emit('prerender');
|
||||
|
||||
this._borderStops = {};
|
||||
|
|
|
@ -212,7 +212,7 @@ Terminal.prototype.bootstrap = function() {
|
|||
|
||||
this.on('destroy', function() {
|
||||
self.kill();
|
||||
self.screen.program.removeListener('data', self._onData);
|
||||
self.screen.program.input.removeListener('data', self._onData);
|
||||
});
|
||||
|
||||
if (this.handler) {
|
||||
|
@ -403,6 +403,10 @@ Terminal.prototype.kill = function() {
|
|||
}
|
||||
this.term.refresh = function() {};
|
||||
this.term.write('\x1b[H\x1b[J');
|
||||
if (this.term._blink) {
|
||||
clearInterval(this.term._blink);
|
||||
}
|
||||
this.term.destroy();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue