Skip to content

Commit

Permalink
Cleanup listeners on force close
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jul 24, 2017
1 parent c4b7ece commit d31f42b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/ui/baseUI.js
Expand Up @@ -21,9 +21,7 @@ var UI = module.exports = function (opt) {
process.on('exit', this.onForceClose);

// Terminate process on SIGINT (which will call process.on('exit') in return)
this.rl.on('SIGINT', function () {
process.kill(process.pid, 'SIGINT');
});
this.rl.on('SIGINT', this.onForceClose);
};

/**
Expand All @@ -33,6 +31,7 @@ var UI = module.exports = function (opt) {

UI.prototype.onForceClose = function () {
this.close();
process.kill(process.pid, 'SIGINT');
console.log('');
};

Expand Down

0 comments on commit d31f42b

Please sign in to comment.