Skip to content

Commit

Permalink
#212879 dispose child instantiation service
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jun 28, 2024
1 parent fe473c8 commit 2e0c439
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/vs/workbench/browser/parts/views/viewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ export abstract class ViewPane extends Pane implements IView {
const viewLocationKey = this.scopedContextKeyService.createKey('viewLocation', ViewContainerLocationToString(viewDescriptorService.getViewLocationById(this.id)!));
this._register(Event.filter(viewDescriptorService.onDidChangeLocation, e => e.views.some(view => view.id === this.id))(() => viewLocationKey.set(ViewContainerLocationToString(viewDescriptorService.getViewLocationById(this.id)!))));

this.menuActions = this._register(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])).createInstance(CompositeMenuActions, options.titleMenuId ?? MenuId.ViewTitle, MenuId.ViewTitleContext, { shouldForwardArgs: !options.donotForwardArgs, renderShortTitle: true }));
const childInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
this.menuActions = this._register(childInstantiationService.createInstance(CompositeMenuActions, options.titleMenuId ?? MenuId.ViewTitle, MenuId.ViewTitleContext, { shouldForwardArgs: !options.donotForwardArgs, renderShortTitle: true }));
this._register(this.menuActions.onDidChange(() => this.updateActions()));
}

Expand Down Expand Up @@ -747,7 +748,8 @@ export abstract class FilterViewPane extends ViewPane {
accessibleViewService?: IAccessibleViewInformationService
) {
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService, accessibleViewService);
this.filterWidget = this._register(instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])).createInstance(FilterWidget, options.filterOptions));
const childInstantiationService = this._register(instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
this.filterWidget = this._register(childInstantiationService.createInstance(FilterWidget, options.filterOptions));
}

override getFilterWidget(): FilterWidget {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/output/browser/outputView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export class OutputViewPane extends ViewPane {
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
this.scrollLockContextKey = CONTEXT_OUTPUT_SCROLL_LOCK.bindTo(this.contextKeyService);

const editorInstantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService]));
this.editor = editorInstantiationService.createInstance(OutputEditor);
const editorInstantiationService = this._register(instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
this.editor = this._register(editorInstantiationService.createInstance(OutputEditor));
this._register(this.editor.onTitleAreaUpdate(() => {
this.updateTitle(this.editor.getTitle());
this.updateActions();
Expand Down

0 comments on commit 2e0c439

Please sign in to comment.