1
0
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:
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>
/// 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;