From 3ee89f5ead985bf85b54f6cbc9bcb1d4fcbc5c3c Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 4 Sep 2017 16:52:54 +0200 Subject: [PATCH] double cancel dummy cancellation token --- src/vs/base/common/cancellation.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/base/common/cancellation.ts b/src/vs/base/common/cancellation.ts index cfd7feae295..b05c8880c54 100644 --- a/src/vs/base/common/cancellation.ts +++ b/src/vs/base/common/cancellation.ts @@ -84,8 +84,10 @@ export class CancellationTokenSource { // cancelled token when cancellation happens // before someone asks for the token this._token = CancellationToken.Cancelled; - } else { - (this._token).cancel(); + + } else if (this._token instanceof MutableToken) { + // actually cancel + this._token.cancel(); } }