File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,7 @@ export class Controller {
109109 - https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts
110110 */
111111 async dispose ( ) {
112- this . outputChannel . appendLine ( "Disposing ClineProvider..." )
113112 await this . clearTask ( )
114- this . outputChannel . appendLine ( "Cleared task" )
115113 while ( this . disposables . length ) {
116114 const x = this . disposables . pop ( )
117115 if ( x ) {
@@ -120,7 +118,6 @@ export class Controller {
120118 }
121119 this . workspaceTracker . dispose ( )
122120 this . mcpHub . dispose ( )
123- this . outputChannel . appendLine ( "Disposed all disposables" )
124121
125122 console . error ( "Controller disposed" )
126123 }
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ export class WebviewProvider implements vscode.WebviewViewProvider {
5959 return Array . from ( this . activeInstances ) . filter ( ( instance ) => instance . view && "onDidChangeViewState" in instance . view )
6060 }
6161
62+ public static async disposeAllInstances ( ) {
63+ const instances = Array . from ( this . activeInstances )
64+ for ( const instance of instances ) {
65+ await instance . dispose ( )
66+ }
67+ }
68+
6269 async resolveWebviewView ( webviewView : vscode . WebviewView | vscode . WebviewPanel ) {
6370 this . view = webviewView
6471
Original file line number Diff line number Diff line change @@ -636,11 +636,15 @@ const { IS_DEV, DEV_WORKSPACE_FOLDER } = process.env
636636
637637// This method is called when your extension is deactivated
638638export async function deactivate ( ) {
639+ // Dispose all webview instances
640+ await WebviewProvider . disposeAllInstances ( )
641+
639642 await telemetryService . sendCollectedEvents ( )
640643
641644 // Clean up test mode
642645 cleanupTestMode ( )
643646 await posthogClientProvider . shutdown ( )
647+
644648 Logger . log ( "Cline extension deactivated" )
645649}
646650
You can’t perform that action at this time.
0 commit comments