diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 383256dcc..175f4ff84 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -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;