Revert "Dispose the old CancellationTokenSource atomically to avoid races"

This reverts commit 2672512a62.
This commit is contained in:
Jack251970 2025-05-06 19:17:33 +08:00
parent 2672512a62
commit 788cb3cc16

View file

@ -1268,9 +1268,9 @@ namespace Flow.Launcher.ViewModel
var isHomeQuery = query.RawQuery == string.Empty;
var oldSource = Interlocked.Exchange(ref _updateSource, new CancellationTokenSource());
_updateSource?.Dispose(); // Dispose old update source to fix possible cancellation issue
_updateSource = new CancellationTokenSource();
_updateToken = _updateSource.Token;
oldSource?.Dispose(); // Dispose old update source to fix possible cancellation issue
ProgressBarVisibility = Visibility.Hidden;
_isQueryRunning = true;