diff --git a/src/HLAdapter.hx b/src/HLAdapter.hx index 747db2a..815998c 100644 --- a/src/HLAdapter.hx +++ b/src/HLAdapter.hx @@ -243,9 +243,8 @@ class HLAdapter extends DebugSession { js.Node.process.env.set('LIBHL_PATH', js.node.Path.dirname(args.hl)); } - debug("Start process " + hlPath + " " + hlArgs); - proc = ChildProcess.spawn(hlPath, hlArgs, {cwd: args.cwd, env:args.env}); + debug("Start process " + hlPath + " " + hlArgs + " pid=" + proc.pid); proc.stdout.setEncoding('utf8'); var prev = ""; proc.stdout.on('data', function(buf) { @@ -1062,6 +1061,13 @@ class HLAdapter extends DebugSession { override function completionsRequest(response:CompletionsResponse, args:CompletionsArguments) { debug("Unhandled request"); } override function setExpressionRequest(response:SetExpressionResponse, args:SetExpressionArguments) { debug("Unhandled request"); } + override function dispose() { + super.dispose(); + debug("Dispose"); + inst = null; + return null; + } + function sendToOutput(output:String, category:OutputEventCategory = Console) { sendEvent(new OutputEvent(output + "\n", category)); }