Skip to content

Commit e973708

Browse files
authored
Fix leaked disposable warnings in the help pane (#9202)
Addresses: #9201
1 parent 5d4150d commit e973708

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/vs/workbench/contrib/positronHelp/browser/components/actionBars.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ export const ActionBars = (props: PropsWithChildren<ActionBarsProps>) => {
130130
const disposableStore = new DisposableStore();
131131

132132
// Add the onDidChangeTitle event handler.
133-
currentHelpEntry.onDidChangeTitle(() => {
133+
disposableStore.add(currentHelpEntry.onDidChangeTitle(() => {
134134
// Set the current help title.
135135
setCurrentHelpTitle(currentHelpEntry.title);
136-
});
136+
}));
137137

138138
// Return the cleanup function.
139139
return () => disposableStore.dispose();

src/vs/workbench/contrib/positronHelp/browser/helpEntry.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ export class HelpEntry extends Disposable implements IHelpEntry, WebviewFindDele
467467
});
468468

469469
// Add the onMessage event handler to the help overlay webview.
470-
this._helpOverlayWebview.onMessage(async e => {
470+
this._register(this._helpOverlayWebview.onMessage(async e => {
471471
const message = e.message as PositronHelpMessage;
472472
switch (message.id) {
473473
// positron-help-interactive message.
@@ -574,7 +574,7 @@ export class HelpEntry extends Disposable implements IHelpEntry, WebviewFindDele
574574
break;
575575
}
576576
}
577-
});
577+
}));
578578

579579
// Set the HTML of the help overlay webview.
580580
this._helpOverlayWebview.setHtml(
@@ -646,13 +646,13 @@ export class HelpEntry extends Disposable implements IHelpEntry, WebviewFindDele
646646
helpOverlayWebview.claim(element, DOM.getWindow(element), undefined);
647647
helpOverlayWebview.layoutWebviewOverElement(element);
648648

649-
helpOverlayWebview.onDidFocus(() => {
649+
this._register(helpOverlayWebview.onDidFocus(() => {
650650
this.helpFocusedContextKey.set(true);
651-
});
651+
}));
652652

653-
helpOverlayWebview.onDidBlur(() => {
653+
this._register(helpOverlayWebview.onDidBlur(() => {
654654
this.helpFocusedContextKey.set(false);
655-
});
655+
}));
656656

657657
// Run logic for animating cases.
658658
ensureWebviewSizeCorrectWhenAnimating();

src/vs/workbench/contrib/positronHelp/browser/positronHelpService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,9 @@ class PositronHelpService extends Disposable implements IPositronHelpService {
754754
);
755755

756756
// Add the onDidNavigate event handler.
757-
helpEntry.onDidNavigate(url => {
757+
this._register(helpEntry.onDidNavigate(url => {
758758
this.navigate(helpEntry.sourceUrl, url);
759-
});
759+
}));
760760

761761
// Add the help entry.
762762
this.addHelpEntry(helpEntry);

0 commit comments

Comments
 (0)