1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Improved Stop of DeviceUpdateTrigger

This commit is contained in:
Darth Affe 2023-05-15 22:50:47 +02:00
parent a196d2a0a4
commit 1532e31a33

View File

@ -133,7 +133,7 @@ public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
/// <summary> /// <summary>
/// Stops the trigger. /// Stops the trigger.
/// </summary> /// </summary>
public async void Stop() public virtual async void Stop()
{ {
if (!IsRunning) return; if (!IsRunning) return;
@ -141,7 +141,9 @@ public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
UpdateTokenSource?.Cancel(); UpdateTokenSource?.Cancel();
if (UpdateTask != null) if (UpdateTask != null)
await UpdateTask; try { await UpdateTask.ConfigureAwait(false); }
catch (TaskCanceledException) { }
catch (OperationCanceledException) { }
UpdateTask?.Dispose(); UpdateTask?.Dispose();
UpdateTask = null; UpdateTask = null;