mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
fixes #61561
This commit is contained in:
parent
36bf69fc87
commit
e34c00f63e
|
@ -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));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue