mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Improved Stop of DeviceUpdateTrigger
This commit is contained in:
parent
a196d2a0a4
commit
1532e31a33
@ -133,7 +133,7 @@ public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
|
||||
/// <summary>
|
||||
/// Stops the trigger.
|
||||
/// </summary>
|
||||
public async void Stop()
|
||||
public virtual async void Stop()
|
||||
{
|
||||
if (!IsRunning) return;
|
||||
|
||||
@ -141,7 +141,9 @@ public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
|
||||
|
||||
UpdateTokenSource?.Cancel();
|
||||
if (UpdateTask != null)
|
||||
await UpdateTask;
|
||||
try { await UpdateTask.ConfigureAwait(false); }
|
||||
catch (TaskCanceledException) { }
|
||||
catch (OperationCanceledException) { }
|
||||
|
||||
UpdateTask?.Dispose();
|
||||
UpdateTask = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user