Skip to content

Commit 788cb3c

Browse files
committed
Revert "Dispose the old CancellationTokenSource atomically to avoid races"
This reverts commit 2672512.
1 parent 2672512 commit 788cb3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,9 +1268,9 @@ private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, b
12681268

12691269
var isHomeQuery = query.RawQuery == string.Empty;
12701270

1271-
var oldSource = Interlocked.Exchange(ref _updateSource, new CancellationTokenSource());
1271+
_updateSource?.Dispose(); // Dispose old update source to fix possible cancellation issue
1272+
_updateSource = new CancellationTokenSource();
12721273
_updateToken = _updateSource.Token;
1273-
oldSource?.Dispose(); // Dispose old update source to fix possible cancellation issue
12741274

12751275
ProgressBarVisibility = Visibility.Hidden;
12761276
_isQueryRunning = true;

0 commit comments

Comments
 (0)