From 396af238421458ace5ca9fb0218fd9d02257fdae Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 3 Nov 2020 17:14:04 -0600 Subject: [PATCH] Kill VS Code when process exits This is to ensure it doesn't hang around. --- src/node/entry.ts | 4 ---- src/node/vscode.ts | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/node/entry.ts b/src/node/entry.ts index 3cca62a5..c192158b 100644 --- a/src/node/entry.ts +++ b/src/node/entry.ts @@ -102,10 +102,6 @@ const main = async (args: DefaultedArgs): Promise => { throw new Error("Please pass in a password via the config file or $PASSWORD") } - ipcMain.onDispose(() => { - // TODO: register disposables - }) - const [app, server] = await createApp(args) const serverAddress = ensureAddress(server) await register(app, server, args) diff --git a/src/node/vscode.ts b/src/node/vscode.ts index 5cf826a1..aed005f9 100644 --- a/src/node/vscode.ts +++ b/src/node/vscode.ts @@ -7,6 +7,7 @@ import { arrayify, generateUuid } from "../common/util" import { rootPath } from "./constants" import { settings } from "./settings" import { isFile } from "./util" +import { ipcMain } from "./wrapper" export class VscodeProvider { public readonly serverRootPath: string @@ -16,6 +17,7 @@ export class VscodeProvider { public constructor() { this.vsRootPath = path.resolve(rootPath, "lib/vscode") this.serverRootPath = path.join(this.vsRootPath, "out/vs/server") + ipcMain.onDispose(() => this.dispose()) } public async dispose(): Promise {