Fixes bug with robot not halting, which caused connections, adaptors and devices to not disconnect.
This commit is contained in:
parent
c34a1ee28c
commit
283b05b08a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue