@@ -10,7 +10,7 @@ import { generateUuid } from 'vs/base/common/uuid';
10
10
import * as Types from 'vs/base/common/types' ;
11
11
import * as Platform from 'vs/base/common/platform' ;
12
12
import { IStringDictionary } from 'vs/base/common/collections' ;
13
- import { IDisposable } from 'vs/base/common/lifecycle' ;
13
+ import { Disposable , IDisposable } from 'vs/base/common/lifecycle' ;
14
14
15
15
import { IWorkspace , IWorkspaceContextService , IWorkspaceFolder } from 'vs/platform/workspace/common/workspace' ;
16
16
@@ -414,7 +414,7 @@ namespace TaskFilterDTO {
414
414
}
415
415
416
416
@extHostNamedCustomer ( MainContext . MainThreadTask )
417
- export class MainThreadTask implements MainThreadTaskShape {
417
+ export class MainThreadTask extends Disposable implements MainThreadTaskShape {
418
418
419
419
private readonly _extHostContext : IExtHostContext | undefined ;
420
420
private readonly _proxy : ExtHostTaskShape ;
@@ -426,9 +426,10 @@ export class MainThreadTask implements MainThreadTaskShape {
426
426
@IWorkspaceContextService private readonly _workspaceContextServer : IWorkspaceContextService ,
427
427
@IConfigurationResolverService private readonly _configurationResolverService : IConfigurationResolverService
428
428
) {
429
+ super ( ) ;
429
430
this . _proxy = extHostContext . getProxy ( ExtHostContext . ExtHostTask ) ;
430
431
this . _providers = new Map ( ) ;
431
- this . _taskService . onDidStateChange ( async ( event : ITaskEvent ) => {
432
+ this . _register ( this . _taskService . onDidStateChange ( async ( event : ITaskEvent ) => {
432
433
if ( event . kind === TaskEventKind . Changed ) {
433
434
return ;
434
435
}
@@ -453,14 +454,15 @@ export class MainThreadTask implements MainThreadTaskShape {
453
454
} else if ( event . kind === TaskEventKind . End ) {
454
455
this . _proxy . $OnDidEndTask ( TaskExecutionDTO . from ( task . getTaskExecution ( ) ) ) ;
455
456
}
456
- } ) ;
457
+ } ) ) ;
457
458
}
458
459
459
- public dispose ( ) : void {
460
+ public override dispose ( ) : void {
460
461
for ( const value of this . _providers . values ( ) ) {
461
462
value . disposable . dispose ( ) ;
462
463
}
463
464
this . _providers . clear ( ) ;
465
+ super . dispose ( ) ;
464
466
}
465
467
466
468
$createTaskId ( taskDTO : ITaskDTO ) : Promise < string > {
0 commit comments