Fixes bug with robot not halting, which caused connections, adaptors and devices to not disconnect.

This commit is contained in:
edgarsilva 2014-04-21 17:46:02 -05:00
parent c34a1ee28c
commit 283b05b08a
1 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ var Cylon = (function() {
//
// Returns a Master instance
function Master() {
this.self = this;
var _this = this;
this.api_instance = null;
this.robots = [];
@ -64,7 +64,7 @@ var Cylon = (function() {
}
process.on("SIGINT", function() {
Cylon.getInstance().halt();
_this.halt();
process.kill(process.pid);
});
}
@ -218,7 +218,7 @@ var Cylon = (function() {
// Returns an Cylon.ApiServer instance
Master.prototype.startAPI = function() {
var Server = require('./api');
this.api_config.master = this.self;
this.api_config.master = this;
if (this.api_instance === null) {
this.api_instance = new Server(this.api_config);