fix terminal element destroy. do not render if screen is destroyed.

This commit is contained in:
Christopher Jeffrey 2015-08-07 21:02:16 -07:00
parent b54e86d361
commit 29c9d1529a
2 changed files with 7 additions and 1 deletions

View File

@ -717,6 +717,8 @@ Screen.prototype.alloc = function() {
Screen.prototype.render = function() {
var self = this;
if (this.destroyed) return;
this.emit('prerender');
this._borderStops = {};

View File

@ -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();
};
/**