From 14c5897e39c524341e011c4ad6ec4b56f2c273b2 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Mon, 19 Sep 2016 15:44:17 +0300 Subject: [PATCH] Fixed: node processes increase after every change with debug --watch --- lib/services/ios-debug-service.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/services/ios-debug-service.ts b/lib/services/ios-debug-service.ts index 82449daecb..c2edfe5ada 100644 --- a/lib/services/ios-debug-service.ts +++ b/lib/services/ios-debug-service.ts @@ -38,6 +38,7 @@ class IOSDebugService implements IDebugService { private _lldbProcess: ChildProcess; private _sockets: net.Socket[] = []; + private _childProcess: ChildProcess; public get platform(): string { return "ios"; @@ -85,11 +86,15 @@ class IOSDebugService implements IDebugService { socket.destroy(); } this._sockets = []; - if (this._lldbProcess) { + if (this._lldbProcess) { this._lldbProcess.stdin.write("process detach\n"); this._lldbProcess.kill(); this._lldbProcess = undefined; } + if (this._childProcess) { + this._childProcess.kill(); + this._childProcess = undefined; + } }).future()(); } @@ -108,6 +113,7 @@ class IOSDebugService implements IDebugService { skipInstall: this.$config.debugLivesync }).wait(); let lineStream = byline(child_process.stdout); + this._childProcess = child_process; lineStream.on('data', (line: NodeBuffer) => { let lineText = line.toString();