提交 e34c00f6 编写于 作者: J Joao Moreno

fixes #61561

上级 36bf69fc
......@@ -62,8 +62,14 @@ const eventPrefix = 'monacoworkbench';
function main(server: Server, initData: ISharedProcessInitData, configuration: ISharedProcessConfiguration): void {
const services = new ServiceCollection();
const disposables: IDisposable[] = [];
process.once('exit', () => dispose(disposables));
const onExit = () => dispose(disposables);
process.once('exit', onExit);
ipcRenderer.once('handshake:goodbye', onExit);
disposables.push(server);
const environmentService = new EnvironmentService(initData.args, process.execPath);
const mainRoute = () => TPromise.as('main');
......
......@@ -15,6 +15,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
import { IStateService } from 'vs/platform/state/common/state';
import { getBackgroundColor } from 'vs/code/electron-main/theme';
import { dispose, toDisposable, IDisposable } from 'vs/base/common/lifecycle';
export class SharedProcess implements ISharedProcess {
......@@ -69,7 +70,11 @@ export class SharedProcess implements ISharedProcess {
this.window.on('close', onClose);
const disposables: IDisposable[] = [];
this.lifecycleService.onShutdown(() => {
dispose(disposables);
// Shut the shared process down when we are quitting
//
// Note: because we veto the window close, we must first remove our veto.
......@@ -98,6 +103,7 @@ export class SharedProcess implements ISharedProcess {
logLevel: this.logService.getLevel()
});
disposables.push(toDisposable(() => sender.send('handshake:goodbye')));
ipcMain.once('handshake:im ready', () => c(void 0));
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册