Skip to content

Commit d03d2fb

Browse files
authored
tunnels: fix shutting down externally-started tunnel (microsoft#201152)
Fixes microsoft/basis-planning#1057
1 parent cd808e5 commit d03d2fb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/vs/platform/remoteTunnel/node/remoteTunnelService.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,18 @@ export class RemoteTunnelService extends Disposable implements IRemoteTunnelServ
209209
this._tunnelProcess = undefined;
210210
}
211211

212-
if (!this._mode.active) {
213-
return;
214-
}
215-
216-
// Be careful to only uninstall the service if we're the ones who installed it:
217-
const needsServiceUninstall = this._mode.asService;
218-
this.setMode(INACTIVE_TUNNEL_MODE);
212+
if (this._mode.active) {
213+
// Be careful to only uninstall the service if we're the ones who installed it:
214+
const needsServiceUninstall = this._mode.asService;
215+
this.setMode(INACTIVE_TUNNEL_MODE);
219216

220-
try {
221-
if (needsServiceUninstall) {
222-
this.runCodeTunnelCommand('uninstallService', ['service', 'uninstall']);
217+
try {
218+
if (needsServiceUninstall) {
219+
this.runCodeTunnelCommand('uninstallService', ['service', 'uninstall']);
220+
}
221+
} catch (e) {
222+
this._logger.error(e);
223223
}
224-
} catch (e) {
225-
this._logger.error(e);
226224
}
227225

228226
try {

0 commit comments

Comments
 (0)