Leaking event listener (fix #207417) (#207472)

This commit is contained in:
Benjamin Pasero 2024-03-13 15:01:11 +01:00 committed by GitHub
parent 3c1caff66c
commit ab206379cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,11 +52,11 @@ export abstract class AbstractLifecycleService extends Disposable implements ILi
this._startupKind = this.resolveStartupKind();
// Save shutdown reason to retrieve on next startup
this.storageService.onWillSaveState(e => {
this._register(this.storageService.onWillSaveState(e => {
if (e.reason === WillSaveStateReason.SHUTDOWN) {
this.storageService.store(AbstractLifecycleService.LAST_SHUTDOWN_REASON_KEY, this.shutdownReason, StorageScope.WORKSPACE, StorageTarget.MACHINE);
}
});
}));
}
private resolveStartupKind(): StartupKind {