提交 dc7d1e9a 编写于 作者: B Benjamin Pasero

make sure to dispose fileservice onshutdown

上级 e3ce57ab
......@@ -382,9 +382,9 @@ export class Workbench implements IPartService {
serviceCollection.set(IWorkbenchEditorService, this.editorService);
serviceCollection.set(IEditorGroupService, this.editorPart);
// File Service
const fileService = this.instantiationService.createInstance(FileService);
serviceCollection.set(IFileService, fileService);
this.toDispose.push(fileService);
// History
serviceCollection.set(IHistoryService, this.instantiationService.createInstance(HistoryService));
......
......@@ -24,6 +24,7 @@ import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/edito
import {IMessageService, IMessageWithAction, Severity} from 'vs/platform/message/common/message';
import {IEnvironmentService} from 'vs/platform/environment/common/environment';
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle';
import {shell} from 'electron';
......@@ -46,6 +47,7 @@ export class FileService implements IFileService {
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IEnvironmentService private environmentService: IEnvironmentService,
@IEditorGroupService private editorGroupService: IEditorGroupService,
@ILifecycleService private lifecycleService: ILifecycleService,
@IMessageService private messageService: IMessageService
) {
this.toUnbind = [];
......@@ -107,6 +109,9 @@ export class FileService implements IFileService {
// Editor changing
this.toUnbind.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));
// Lifecycle
this.lifecycleService.onShutdown(this.dispose, this);
}
private onEditorsChanged(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册