mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Dispose the old CancellationTokenSource atomically to avoid races
This commit is contained in:
parent
b156afed0b
commit
2672512a62
1 changed files with 2 additions and 2 deletions
|
|
@ -1268,9 +1268,9 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
var isHomeQuery = query.RawQuery == string.Empty;
|
||||
|
||||
_updateSource?.Dispose(); // Dispose old update source to fix possible cancellation issue
|
||||
_updateSource = new CancellationTokenSource();
|
||||
var oldSource = Interlocked.Exchange(ref _updateSource, new CancellationTokenSource());
|
||||
_updateToken = _updateSource.Token;
|
||||
oldSource?.Dispose(); // Dispose old update source to fix possible cancellation issue
|
||||
|
||||
ProgressBarVisibility = Visibility.Hidden;
|
||||
_isQueryRunning = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue