mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Merge pull request #295099 from mjbvz/dev/mjbvz/enormous-kingfisher
Fix leak warning around events
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Disposable, DisposableStore } from '../../../base/common/lifecycle.js';
|
||||
import { Disposable } from '../../../base/common/lifecycle.js';
|
||||
import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js';
|
||||
import { ExtHostContext, ExtHostPowerShape, MainContext, MainThreadPowerShape, PowerSaveBlockerType, PowerSystemIdleState, PowerThermalState } from '../common/extHost.protocol.js';
|
||||
import { IPowerService } from '../../services/power/common/powerService.js';
|
||||
@@ -12,7 +12,6 @@ import { IPowerService } from '../../services/power/common/powerService.js';
|
||||
export class MainThreadPower extends Disposable implements MainThreadPowerShape {
|
||||
|
||||
private readonly proxy: ExtHostPowerShape;
|
||||
private readonly disposables = this._register(new DisposableStore());
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@@ -22,14 +21,14 @@ export class MainThreadPower extends Disposable implements MainThreadPowerShape
|
||||
this.proxy = extHostContext.getProxy(ExtHostContext.ExtHostPower);
|
||||
|
||||
// Forward power events to extension host
|
||||
this.powerService.onDidSuspend(this.proxy.$onDidSuspend, this.proxy, this.disposables);
|
||||
this.powerService.onDidResume(this.proxy.$onDidResume, this.proxy, this.disposables);
|
||||
this.powerService.onDidChangeOnBatteryPower(this.proxy.$onDidChangeOnBatteryPower, this.proxy, this.disposables);
|
||||
this.powerService.onDidChangeThermalState((state: PowerThermalState) => this.proxy.$onDidChangeThermalState(state), this, this.disposables);
|
||||
this.powerService.onDidChangeSpeedLimit(this.proxy.$onDidChangeSpeedLimit, this.proxy, this.disposables);
|
||||
this.powerService.onWillShutdown(this.proxy.$onWillShutdown, this.proxy, this.disposables);
|
||||
this.powerService.onDidLockScreen(this.proxy.$onDidLockScreen, this.proxy, this.disposables);
|
||||
this.powerService.onDidUnlockScreen(this.proxy.$onDidUnlockScreen, this.proxy, this.disposables);
|
||||
this._register(this.powerService.onDidSuspend(this.proxy.$onDidSuspend, this.proxy));
|
||||
this._register(this.powerService.onDidResume(this.proxy.$onDidResume, this.proxy));
|
||||
this._register(this.powerService.onDidChangeOnBatteryPower(this.proxy.$onDidChangeOnBatteryPower, this.proxy));
|
||||
this._register(this.powerService.onDidChangeThermalState((state: PowerThermalState) => this.proxy.$onDidChangeThermalState(state), this));
|
||||
this._register(this.powerService.onDidChangeSpeedLimit(this.proxy.$onDidChangeSpeedLimit, this.proxy));
|
||||
this._register(this.powerService.onWillShutdown(this.proxy.$onWillShutdown, this.proxy));
|
||||
this._register(this.powerService.onDidLockScreen(this.proxy.$onDidLockScreen, this.proxy));
|
||||
this._register(this.powerService.onDidUnlockScreen(this.proxy.$onDidUnlockScreen, this.proxy));
|
||||
}
|
||||
|
||||
async $getSystemIdleState(idleThreshold: number): Promise<PowerSystemIdleState> {
|
||||
|
||||
Reference in New Issue
Block a user